Re: problem with chained validators

"Matthew Wilson" <[email protected]> Tue, 28 Oct 2008 11:40:32 -0400
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
On Tue, Oct 28, 2008 at 3:32 AM, Marcin StÄ™pnicki <[email protected]> wrote:

> Could someone put me on the right track?

Take a look at my edits to your code: http://arag0rn.pastebin.pl/3220

I pulled your validate1 function out from inside your MySchema class
and I added some logging to make debugging a little more
straightforward.  Here's what I get when I run the code now:

DEBUG:root:testing out logger...
DEBUG:root:locals inside here: {'state': None,
 'validator': <SimpleFormValidator object 76 func=<function validate1
at 0x85c7f0c> validate_partial_form=True>,
 'value_dict': {'a': 321, 'b': '', 'other1': 'True', 'other1_name': ''}}
{'other1_name': u'Field cannot be blank'}

Now your validate1 method does get invoked even though b is empty.

Matt

-- 
Matthew Wilson
[email protected]
http://tplus1.com
-------------------------------------------------------------------------
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=/