Example
validation schema:
1 class ValidToken(formencode.FancyValidator): 2 def _to_python(self, value, state): 3 if value == None 4 raise formencode.Invalid( 5 "Must have a value", value, state) 6 return value
controller:
1 # controller method 2 input_val = None 3 try: 4 val = ValidToken.to_python(input_val) 5 except formencode.Invalid, e: 6 return "Failed due to invalid value" 7 return "OK"
The expected output: Failed due to invalid value
Actual output: OK

yliu