def new_watchlist(): username = session["__auth"] form = WatchlistForm(username) db = Watchlist() if form.validate_on_submit(): list_name = form.title.data body = form.content.data db.add_watchlist(username, list_name, body) return redirect(url_for("watchlists", username=username)) return render_template('newlist.html', form=form, title="New Flow", )
def new_filmInlist(film_id): username = session["__auth"] form = WatchlistForm(username) db = Watchlist() if form.validate_on_submit(): list_name = form.title.data body = form.content.data if request.form.get("mycheckbox"): db.add_watchlist(username, list_name, body) list_id = db.get_list_id(username, session['__auth'], list_name) db.add_film(list_id, film_id) else: db.add_watchlist(username, list_name, body) return redirect(url_for("movie", film_id=film_id)) return render_template('newlist.html', form=form, title="New Flow", checkbox=True)