Problems with Formencode Msgs, Unexpected Inputs
"Tom Longson (nym)" <[email protected]> Fri, 3 Oct 2008 11:15:04 -0700
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm trying to get formencode to work, and I have a few problems:
1. How do you supply custom error messages? I've read the documentation, and
couldn't find a concrete example using preexisting validators.
2. Why am i getting this error list with the included test file?
List of dictionaries:
[{'name': 'Tom'}, {'email': 'tom-1ejvVKqOCHmevrI51Aqiyd1ocvOgFGy0LpsAlfeDtJ10ubjbjo6WXg@public.gmane.org'},
{'password': 'narfffff0'}, {'password_confirm': 'narfffff0'}]
Error list:
[Invalid('email: Missing value\npassword: Missing value\npassword_confirm:
Missing value',), Invalid('name: Missing value\npassword: Missing
value\npassword_confirm: Missing value',), Invalid('email: Missing
value\nname: Missing value\npassword_confirm: Missing value',),
Invalid('email: Missing value\nname: Missing value\npassword: Missing
value',)]
3. If I supply a value to the list of dictionaries that is not expected by
the Schema (e.g. "foobar"), how do I get the Schema to ignore it instead of
throwing an Invalid(u"The input field '%s' was not expected.",) ?
Thanks!
nym
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/formencode-discuss