[FE-discuss] messages are awkward for formencode.validators.…

Top Page
Author: Jonathan Vanasco
Date:  
To: formencode-discuss
Subject: [FE-discuss] messages are awkward for formencode.validators.NotEmpty
i don't know if this is because docs or a changing config, but...

- i created a formencode.validators.NotEmpty instance
- i kept getting "Missing Value" errors that i needed to customize
- the class itself has this:

     messages = {
         'empty': _("Please enter a value"),
         }

which didn't make since, because I wasn't getting that error.

so i tried
        is_tos= formencode.validators.NotEmpty( messages={ 'empty': 'You  
must check this box to register' })

that didn't work.

searching all of Formencode, i got the idea to try this:
         is_tos= formencode.validators.NotEmpty( messages={ 'empty':  
'You must check this box to register.', 'missingValue': 'You must
check this box to register..' } )

that didn't work either.

looking at the changelog, i finally figured out how to customize that
error:
         is_tos= formencode.validators.NotEmpty( messages={ 'empty':  
'You must check this box to register.', 'missingValue': 'You must
check this box to register..' , 'missing': 'You must check this box
to register...' } )

it would be nice if things were a bit more straightforward.

is the empty ever called for the NotEmpty ? should that just be
'missing' ?

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss@???
https://lists.sourceforge.net/lists/listinfo/formencode-discuss