validate_partial getting raw values
"Yoann Roman" <yroman-formencode-97L2/VFWZOVWk0Htik3J/[email protected]> Wed, 16 Dec 2009 09:34:22 -0500
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
I'm creating a custom FormValidator with support for partial validation,
which I'm using as a chained validator. My problem is that the schema
feeds it the raw value_dict instead of the partially processed form
fields. I narrowed this down to line 185 of schema.py:
for validator in self.chained_validators:
if (not hasattr(validator, 'validate_partial')
or not getattr(validator, 'validate_partial_form', False)):
continue
try:
validator.validate_partial(value_dict, state)
^^^^^^^^^^
except Invalid, e:
sub_errors = e.unpack_errors()
if not isinstance(sub_errors, dict):
# Can't do anything here
continue
merge_dicts(errors, sub_errors)
Shouldn't that be validator.validate_partial(new, state) instead or is
it intentional that partial validation gets the raw value_dict while
full validation gets processed fields?
Thanks,
--
Yoann Roman
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev