As Jorge says, you could have that right now in TG. Alternatively you
could just read the formencode docs and use chained validators for
your password fields. Here's an example of a validator schema from
one of my projects for a new user:
class NewUserSchema(validators.Schema):
user_name = validators.All(validators.PlainText(not_empty=True,
max=16, strip=True),
UniqueUsername())
email = validators.All(validators.Email(not_empty=True, max=255),
UniqueEmail())
email_2 = validators.All(validators.Email(not_empty=True, max=255))
display_name = validators.UnicodeString(not_empty=True, strip=True, max=255)
password = validators.UnicodeString(not_empty=True, max=40)
password_2 = validators.UnicodeString(not_empty=True, max=40)
town = validators.UnicodeString()
region = validators.UnicodeString()
country = validators.UnicodeString()
chained_validators = [validators.FieldsMatch('password', 'password_2'),
validators.FieldsMatch('email', 'email_2')]
Note the chained_validators list. This will ensure that the field
named 'password' matches the field named 'password_2' and will act
like any other validation error.
Lee
--
Lee McFadden
blog: http://www.splee.co.uk
work: http://fireflisystems.com
skype: fireflisystems
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---