From dc3f13df54ba91649ecec2bdee6c24ca31a400a8 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 23 Apr 2010 12:17:12 +0200 Subject: [PATCH] Corrected validator usage in the wtforms docs. --- docs/patterns/wtforms.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/patterns/wtforms.rst b/docs/patterns/wtforms.rst index 4a836975..bbceee8a 100644 --- a/docs/patterns/wtforms.rst +++ b/docs/patterns/wtforms.rst @@ -22,9 +22,11 @@ This is an example form for a typical registration page:: class RegistrationForm(Form): username = TextField('Username', [validators.Length(min=4, max=25)]) email = TextField('Email Address', [validators.Length(min=6, max=35)]) - password = PasswordField('New Password', [validators.Required()]) - confirm = PasswordField('Repeat Password', [validators.EqualTo( - 'confirm', message='Passwords must match')]) + password = PasswordField('New Password', [ + validators.Required(), + validators.EqualTo('confirm', message='Passwords must match') + ]) + confirm = PasswordField('Repeat Password') accept_tos = BooleanField('I accept the TOS', [validators.Required()]) In the View