Skip to content

Instantly share code, notes, and snippets.

@martinsam
Created August 26, 2016 12:49
Show Gist options
  • Save martinsam/7a992efeca08cfdd325dcca6dfceb063 to your computer and use it in GitHub Desktop.
Save martinsam/7a992efeca08cfdd325dcca6dfceb063 to your computer and use it in GitHub Desktop.
Formulaire Flask
from wtforms import Form, BooleanField, StringField, PasswordField, validators
class RegistrationForm(Form):
username = StringField('Username', [validators.Length(min=4, max=25)])
email = StringField('Email Address', [validators.Length(min=6, max=35)])
password = PasswordField('New Password', [
validators.DataRequired(),
validators.EqualTo('confirm', message='Passwords must match')
])
confirm = PasswordField('Repeat Password')
accept_tos = BooleanField('I accept the TOS', [validators.DataRequired()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment