Created
August 26, 2016 12:49
-
-
Save martinsam/7a992efeca08cfdd325dcca6dfceb063 to your computer and use it in GitHub Desktop.
Formulaire Flask
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
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