Hello,
I have defined a IS_IN_SET validator inside my models. Now, I want to use
the same list inside controllers and views. What is the best way to re-use
the same list inside controllers and views without having to duplicate the
code. Right now, I just copied the entire list inside my controller. So, if
I have to change anything, I have to change it at two places.
db.define_table('products',
Field('type'),
auth.signature)
db.products.type.requires = IS_IN_SET(['Type1', 'Type2', 'Type3'])
An example snippet would be highly appreciated.
Thanks !
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.