Commits

James Crasta committed 7fd11e4

Remove references to the old Required validator name.

Comments (0)

Files changed (4)

docs/crash_course.rst

     class RegistrationForm(Form):
         username     = TextField('Username', [validators.Length(min=4, max=25)])
         email        = TextField('Email Address', [validators.Length(min=6, max=35)])
-        accept_rules = BooleanField('I accept the site rules', [validators.Required()])
+        accept_rules = BooleanField('I accept the site rules', [validators.InputRequired()])
 
 When you create a form, you define the fields in a way that is similar to the
-way many ORM’s have you define their columns; By defining class variables which
+way many ORM’s have you define their columns: By defining class variables which
 are instantiations of the fields.
 
 Because forms are regular Python classes, you can easily extend them as you
 declaratively as class attributes::
 
     class MyForm(Form):
-        first_name = TextField(u'First Name', validators=[validators.required()])
+        first_name = TextField(u'First Name', validators=[validators.input_required()])
         last_name  = TextField(u'Last Name', validators=[validators.optional()])
 
 Field names can be any valid python identifier, with the following restrictions:
     from wtforms import Form, TextField, IntegerField, validators as v
 
     class RegistrationForm(Form):
-        name = TextField(_(u'Name'), [v.Required(_(u'Please provide your name'))])
+        name = TextField(_(u'Name'), [v.InputRequired(_(u'Please provide your name'))])
         age = IntegerField(
             _(u'Age'),
             [v.NumberRange(min=12, message=_(u'Must be at least %(min)d years old.'))]

docs/validators.rst

     scenarios, the password change form::
 
         class ChangePassword(Form):
-            password = PasswordField('New Password', [Required(), EqualTo('confirm', message='Passwords must match')])
+            password = PasswordField('New Password', [InputRequired(), EqualTo('confirm', message='Passwords must match')])
             confirm  = PasswordField('Repeat Password')
 
-    In the example, we use the Required validator to prevent the EqualTo
+    In the example, we use the InputRequired validator to prevent the EqualTo
     validator from trying to see if the passwords do not match if there was no
-    passwords specified at all. Because Required stops the validation chain,
+    passwords specified at all. Because InputRequired stops the validation chain,
     EqualTo is not run in the case the password field is left empty.
 
 .. autoclass:: wtforms.validators.InputRequired
 Let's start with a simple form with a name field and its validation::
 
     class MyForm(Form):
-        name = TextField('Name', [Required()])
+        name = TextField('Name', [InputRequired()])
 
         def validate_name(form, field):
             if len(field.data) > 50:
             raise ValidationError('Field must be less than 50 characters')
 
     class MyForm(Form):
-        name = TextField('Name', [Required(), my_length_check])
+        name = TextField('Name', [InputRequired(), my_length_check])
 
 All we've done here is move the exact same code out of the class and as a
 function. Since a validator can be any callable which accepts the two
         return _length
 
     class MyForm(Form):
-        name = TextField('Name', [Required(), length(max=50)])
+        name = TextField('Name', [InputRequired(), length(max=50)])
 
 Now we have a configurable length-checking validator that handles both minimum
 and maximum lengths. When ``length(max=50)`` is passed in your validators list,