I'm using a FormEncode Schema to validate a dictionary, and I was
wondering if it would be easy to get the validator to rename fields on
the way through?

Something like:

data = {'email': '[EMAIL PROTECTED]'}

class MyValidator(validators.Schema):
    email = validators.Email(not_empty=True, new_field_name='user_email')

my_validator = MyValidator()

valid_data = my_validator.to_python(data)

print valid_data

## {'user_email': '[EMAIL PROTECTED]'}

Thanks

Ed

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to