Re: problem with chained validators

"Marcin StÄ™pnicki" <[email protected]> Wed, 29 Oct 2008 07:43:24 +0100
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
2008/10/28 Matthew Wilson <[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.

Thank you. You are right, but it didn't return the error message for
_both_ b and other1_name (and it should). Anyway, it seems that we've
found a bug, Ian fixed it and everyone is happy :-).

Regards,
Marcin
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-discuss