Esempio n. 1
0
def public_list(list_name):
    db = Watchlist()
    username = session['__auth']
    if not db.check_watchlist(username, list_name):
        return render_template('404.html')
    db.public_list(username, list_name)
    return redirect(url_for("watchlists", username=username))
Esempio n. 2
0
def del_watchlist(list_name):
    db = Watchlist()
    username = session['__auth']
    if not db.check_watchlist(username, list_name):
        return render_template('404.html')
    list_id = db.get_list_id(username, session['__auth'], list_name)
    db.delete_watchlist(list_id)
    return redirect(url_for("watchlists", username=username))
Esempio n. 3
0
def add_filmInList(list_name, film_id):
    db = Watchlist()
    username = session['__auth']
    if not db.check_watchlist(username, list_name):
        return render_template('404.html')
    list_id = db.get_list_id(username, session['__auth'], list_name)
    db.add_film(list_id, film_id)
    return redirect(url_for('movie', film_id=film_id))
Esempio n. 4
0
def update_list(list_name):
    username = session["__auth"]
    form = UpdateList(username, list_name)
    db = Watchlist()
    username = session['__auth']
    if not db.check_watchlist(username, list_name):
        return render_template('404.html')
    elif form.validate_on_submit():
        list_title = form.title.data
        body = form.content.data
        list_id = db.get_list_id(username, session['__auth'], list_name)
        db.update_watchlist(list_id, list_title, body, username)
        return redirect(url_for("watchlists", username=username))
    form.title.data = list_name
    form.content.data = db.get_list_body(username, list_name)
    return render_template('newlist.html', form=form, title="Update Flow")