Partial validation results from an invalid input?

Daniel Lepage <[email protected]> Mon, 26 Dec 2011 17:12:39 -0500
Newsgroups gmane.comp.python.formencode
Message-ID <CANtoCQ_KbXPjiHYR3Y8ECVAs-d59oa41KAc+WVDwmxcMWBJsRQ@mail.gmail.com>
Hi everyone,

Is there a way to get the python values for successful fields in a
Schema when other fields have failed?

For example, suppose I have the following schema and input value:

sch = Schema(fields=dict(x=Int(), y=DateConverter(), z=Int()))
v = dict(x='12', y='1/16/1973', z='foo')

I'd like to validate v against sch in such a way that I get not only
the error message from z, but also the values 12 and datetime(1973, 1,
16) from x and y, respectively.

Is there a way to do this?

None of my use cases rely on chained_validators, so all I need are the
values computed by the fields of the schema.

Thanks,
Dan Lepage

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev