The Constant class is accessible via the formencode.validators module.
I.e., you pass in the constant value when initializing, then all values get converted to that constant value.
This is only really useful for funny situations, like:
fromEmailValidator = ValidateAny(
ValidEmailAddress(),
Constant('unknown@localhost'))
In this case, the if the email is not valid 'unknown@localhost' will be used instead. Of course, you could use if_invalid instead.
Examples:
>>> Constant('X').to_python('y')
'X'
Messages
See the source for more information.