Value is always string unless filtered by IS_INT_IN_SET

db.table_name.field.requires =  [IS_INT_IN_RANGE
(-10**10,10**10),IS_EXPR('%i <= value <= %i'%(5, 7))]

or

db.table_name.field.requires =  IS_EXPR('%i <= int(value) <= %i'%(5,
7))

but the latter will throw an exception if value does not contain an
int.

I am not sure about your other problem. What do you mean by "does not
work"? Do you have a traceback to show us?


On Jan 19, 7:42 am, "hamdy.a.farag" <hamdy.a.fa...@inbox.com> wrote:
> I also have this problem:
>
> db.table_name.field.requires =  IS_EXPR('%i <= value <= %i'%(5, 7))
> FORM= ..............
>
> Not working
>
> while doing     print IS_EXPR('%i <= value <= %i'%(5, 7))(6) ->   (6,
> None)
>
> so How can I get it work ? do I have to replace the 'value' keyword
> with something ?
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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