Ejemplo n.º 1
0
def detail(num):
    try:
        offenders_dict = offenders_list[int(num) - 1]
    except:
        return f"<h1>Invalid value for Position: {num}</h1>"
    # a little bonus function, imported on line 2 above
    ord = make_ordinal( int(num) )
    return render_template('offenders.html', pres=offenders_dict, ord=ord, the_title=offenders_dict['Idiot'])
Ejemplo n.º 2
0
def detail(num):
    for movie in movies_list:
        if movie['Number'] == num:
            mov_dict = movie
            break
    # a little bonus function, imported
    ord = make_ordinal( int(num) )
    return render_template('movie.html', pres=mov_dict, ord=ord, the_title=mov_dict['Movie'])
Ejemplo n.º 3
0
def detail(num):
    for actor in actor_list:
        if actor['Number'] == num:
            act_dict = actor
            break
    # a little bonus function, imported
    ord = make_ordinal( int(num) )
    return render_template('actor.html', act=act_dict, ord=ord, the_title=act_dict['Actor'])
Ejemplo n.º 4
0
def detail(num):
    for senator in senator_list:
        if senator['District'] == num:
            sen_dict = senator
            break
    ord = make_ordinal(int(num))
    return render_template('senator.html',
                           sen=sen_dict,
                           ord=ord,
                           the_title=sen_dict['Senator'])
Ejemplo n.º 5
0
def detail(num):
    for president in presidents_list:
        if president['Presidency'] == num:
            pres_dict = president
            break
    # a little bonus function, imported
    ord = make_ordinal(int(num))
    return render_template('president.html',
                           pres=pres_dict,
                           ord=ord,
                           the_title=pres_dict['President'])
Ejemplo n.º 6
0
def detail(num):
    for kanye in kanye_list:
        if kanye['Identification'] == num:
            kanye_dict = kanye
            break
    # a little bonus function, imported
    ord = make_ordinal(int(num))
    return render_template('kanye.html',
                           kanye=kanye_dict,
                           ord=ord,
                           the_title=kanye_dict['Single'])
Ejemplo n.º 7
0
def detail(num):
    try:
        pres_dict = presidents_list[int(num) - 1]
    except:
        return f"<h1>Invalid value for Presidency: {num}</h1>"
    # a little bonus function, imported on line 2 above
    ord = make_ordinal(int(num))
    return render_template('president.html',
                           pres=pres_dict,
                           ord=ord,
                           the_title=pres_dict['President'])
Ejemplo n.º 8
0
def detail(num):
    try:
        ###### Select entry from DB using position parameter
        Found = Gits.query.filter_by(position=num).first()
    except:
        return f"<h1>Invalid value for Position: {num}</h1>"

    ord = make_ordinal(int(num))
    return render_template('cants.html',
                           pres=Found,
                           ord=ord,
                           total=Gits.query.count())