Пример #1
0
def new_site_setting():
    form = SiteSettingForm()

    if form.validate_on_submit():
        site_setting = SiteSetting()
        site_setting.name = form.name.data
        site_setting.value = form.value.data

        db.session.add(site_setting)
        flash('"{0}" has been saved'.format(site_setting.name))

        return redirect(url_for('.site_settings'))

    return render_template("admin/site-settings/new.html", form=form)