Skip to content

Instantly share code, notes, and snippets.

@redspider
Created May 13, 2013 21:56
Show Gist options
  • Save redspider/5571864 to your computer and use it in GitHub Desktop.
Save redspider/5571864 to your computer and use it in GitHub Desktop.
def create():
class Form(IForm):
name = wtf.TextField(_('Library Name'), [wtf.Required(), wtf.Length(max=80)])
form = Form()
if form.validate_on_submit():
library = m.Library(
name = form.name.data,
)
library.save()
flask.flash(_("Library created"),category="success")
return redirect(url_for('.index'))
return dict(form=form)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment