forked from orbit-oss/flask
Corrected validator usage in the wtforms docs.
This commit is contained in:
parent
be15340e0f
commit
dc3f13df54
1 changed files with 5 additions and 3 deletions
|
|
@ -22,9 +22,11 @@ This is an example form for a typical registration page::
|
||||||
class RegistrationForm(Form):
|
class RegistrationForm(Form):
|
||||||
username = TextField('Username', [validators.Length(min=4, max=25)])
|
username = TextField('Username', [validators.Length(min=4, max=25)])
|
||||||
email = TextField('Email Address', [validators.Length(min=6, max=35)])
|
email = TextField('Email Address', [validators.Length(min=6, max=35)])
|
||||||
password = PasswordField('New Password', [validators.Required()])
|
password = PasswordField('New Password', [
|
||||||
confirm = PasswordField('Repeat Password', [validators.EqualTo(
|
validators.Required(),
|
||||||
'confirm', message='Passwords must match')])
|
validators.EqualTo('confirm', message='Passwords must match')
|
||||||
|
])
|
||||||
|
confirm = PasswordField('Repeat Password')
|
||||||
accept_tos = BooleanField('I accept the TOS', [validators.Required()])
|
accept_tos = BooleanField('I accept the TOS', [validators.Required()])
|
||||||
|
|
||||||
In the View
|
In the View
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue