For 'integer' and 'double' you can do

db.table.field.requires.error_message=T('message')

or

db.table.field.requires=IS_INT_IN_RANGE(0,10,error_message=T
('message'))

On May 17, 11:36 am, Iceberg <iceb...@21cn.com> wrote:
> The message can be customized by an "error_message" argument.
>   db.Field('foo', 'integer', requires=IS_INT_IN_RANGE
> (0,5,error_message='oops'))
>
> But I havn't tested whether it can be:
>    ..., error_message=T('oops') ...
>
> Maybe you can try and tell us.
>
> On May17, 3:38pm, Alexey Nezhdanov <snak...@gmail.com> wrote:
>
> > Hello again.
>
> > When I do
> > form=SQLFORM(db.table)
> > form.accepts(request.post_vars)
>
> > it displays 'too small or too large' for the 'integer' and 'double'
> > required fields.
> > There are two problems with it:
> > 1) these strings are not translateable by default
> > 2) It is not exactly the proper message to display. Since that is a
> > required field the more appropriate message would be 'This is a
> > required field'
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to