haha. You found a bug. I just fixed it in trunk. For now just use this
workaround
Field('birthdate', 'date',requires = IS_DATE(format=str(T('%Y-%m-
%d')),error_message=str(T('must be
YYYY-MM-DD!')))),
notice the str(T(...)) instead of T(..).
Massimo
On Nov 26, 6:56 am, Johann Spies <[email protected]> wrote:
> In my db.py I have this as part of the auth_table:
>
> Field('birthdate', 'date',requires = IS_DATE(format=T('%Y-%m-%d'),
> error_message=T('must be YYYY-MM-DD!'))),
>
> However, when a non-date is entered, the form accepts it and corrupt
> the database resulting in a ticket.
> Why does this validator not work?
>
> Regards
> Johann
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.