Maybe this?:

import gluon.validators
if isinstance(db.mytable.myfield.requires
[0],gluon.validators.IS_INT_IN_RANGE):
    db.mytable.myfield.requires[0] = IS_INT_IN_RANGE(min=10, max=20)



On Jun 18, 2:16 am, Peter Etchells <peter.a.etche...@gmail.com> 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 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