예제 #1
0
def add():
    form = ExtensionForm()
    if request.method == 'POST' and form.validate_on_submit():
        extensions.add(g.url_rest, form)
        flash('Extension added')
        return redirect(url_for('extensions.list'))
    return render_template('extension_add.html', form=form)
예제 #2
0
def add():
    form = ExtensionForm()
    if request.method == 'POST' and form.validate_on_submit():
        extensions.add(g.url_rest, form)
        flash('Extension added')
        return redirect(url_for('extensions.list'))
    return render_template('extension_add.html', form=form)
예제 #3
0
def edit(id):
    my_extensions = extensions.show(g.url_rest + "/" + id)
    form = ExtensionForm.from_json(my_extensions)
    if form.is_submitted():
        extensions.edit(g.url_rest + "/" + id, ExtensionForm(obj=extensions))
        return redirect(url_for("extensions.list"))
    return render_template('extension_edit.html',
                           extensions=my_extensions,
                           form=form)
예제 #4
0
def edit(id):
    my_extensions = extensions.show(g.url_rest + "/" + id)
    form = ExtensionForm.from_json(my_extensions)
    if form.is_submitted():
        extensions.edit(g.url_rest + "/" + id, ExtensionForm(obj=extensions))
        return redirect(url_for("extensions.list"))
    return render_template('extension_edit.html', extensions=my_extensions, form=form)