Created
May 13, 2013 21:56
-
-
Save redspider/5571864 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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