def list_all_directors():
    directors = db_helper.get_directors()
    if 'user_id' not in login_session:
        user = None
    else:
        user = db_helper.get_user_info(login_session['user_id'])
        directors = db_helper.get_directors_by_creator_id(user.id)
    if not directors:
        flash("No director on the list. Let's add one")
    return render_template('index.html', directors=directors, user=user)
Ejemplo n.º 2
0
def list_all_directors():
    directors = db_helper.get_directors()
    if 'user_id' not in login_session:
        user = None
    else:
        user = db_helper.get_user_info(login_session['user_id'])
        directors = db_helper.get_directors_by_creator_id(user.id)
    if not directors:
        flash("No director on the list. Let's add one")
    return render_template('index.html', directors=directors, user=user)
def directors_json():
    directors = db_helper.get_directors()
    return jsonify(directors=[d.serialize for d in directors])
Ejemplo n.º 4
0
def directors_json():
    directors = db_helper.get_directors()
    return jsonify(directors=[d.serialize for d in directors])