Can chained validators change form data when errors are present?
Felix Schwarz <felix.schwarz-S0/[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
I tried to build a chained validator (FormValidator) which replaces some form data before
raising an Invalid exception (so that it is easier to display the wrong values). Unfortunately,
the data is not changed when I look at it in my main function.
I found the following in schema.py:
---------------------------------------------------------------
for validator in self.chained_validators:
new = validator.to_python(new, state)
return new
finally:
if state is not None:
state.key = previous_key
state.full_dict = previous_full_dict
---------------------------------------------------------------
Is there a way to change the form data in a chained validator when raising an Invalid exception?
fs
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/