Exemplo n.º 1
0
def series_add():
    form = edit_series()
    if form.validate_on_submit():
        controller.add_series(form.data)
        flash('Successfully added a series')
        return redirect(url_for('view_series'))
    return render_template('series_edit.html', page_title='Series Edit', form=form)
Exemplo n.º 2
0
def series_add():
    form = edit_series()
    if form.validate_on_submit():
        controller.add_series(form.data)
        flash('Successfully added a series')
        return redirect(url_for('view_series'))
    return render_template('series_edit.html',
                           page_title='Series Edit',
                           form=form)
Exemplo n.º 3
0
def series_edit(series_id):
    series = controller.get_series_by_id(series_id)
    form = edit_series(title = series.title, begin_date = series.begin_date, end_date = series.end_date)
    if form.validate_on_submit():
        for k,v in form.data.items():
            if v is not None:
                controller.update_series(series_id, k, v)
        flash('Successfully updated')
        return redirect(url_for('view_series'))

    return render_template('series_edit.html', page_title='Series Edit', series=series, form=form)
Exemplo n.º 4
0
def series_edit(series_id):
    series = controller.get_series_by_id(series_id)
    form = edit_series(title=series.title,
                       begin_date=series.begin_date,
                       end_date=series.end_date)
    if form.validate_on_submit():
        for k, v in form.data.items():
            if v is not None:
                controller.update_series(series_id, k, v)
        flash('Successfully updated')
        return redirect(url_for('view_series'))

    return render_template('series_edit.html',
                           page_title='Series Edit',
                           series=series,
                           form=form)