On Tue, 5 Sep 2006 15:42:50 -0500
"Javier Rojas" <[EMAIL PROTECTED]> wrote:

> On 9/5/06, MarAm <[EMAIL PROTECTED]> wrote:
> >
> >
> > I have the field:
> >
> > cuenta = TextField(label="Cuenta", validator = validators.NotEmpty)
> >
> > when 'cuenta' is empty, I show the message:
> > "Please enter a value"
> >
> > How I personalize that? or how show a spanish message:
> > "Por favor, ingrese un valor"
> 
> 
> you have to create a subclass  of the NotEmpty validator, and
> override the "messages" attribute. Check the docs of Formencode to
> find how to do so

Actually, it's not quite that bad.  You can just create an instance of
NotEmpty validator and pass a messages argument to the __init__ method.

Check out the validators.py module in FormEncode.

Though, if you want to do it all over the place, creating a subclass is
probably your best bet.

Jason

-- 
Two years ago, I generated a gpg key that expired August 24, 2006
(686FD13C).  I've now generated a new one (C7EFE9F4).

Attachment: signature.asc
Description: PGP signature

Reply via email to