should be
myfield=db['mytable'][field]
if field.type=='integer':
if isinstance(field.requires[0],validator.IS_INT_IN_RANGE):
minimum = field.requires[0].minimum
maximum = field.requires[0].maximum
On Jun 18, 2:16 am, Peter Etchells <[email protected]> wrote:
> Hi web2pyzeans
> I want to be able to access the type and parameters of validators for
> a given field.
>
> How would I do something like:
> myfield=db['mytable'][field]
> if field.type=='integer':
> if field.requires[0] == validator.IS_INT_IN_RANGE:
> min = the min arg of the IS_INT_IN_RANGE validator for the field
> max= the min arg of the IS_INT_IN_RANGE validator for the field
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---