Hi,
I'm using show_if to hide a filed of my form under certain conditions.
Per web2py guide, show_if uses simple query, but it doesn't work for
logical oprators like "and" "or".
In below example i would like to display field "order" just when colour is
set to "blue" or "red".
db.define_table('table1', Field('colour',
requires=IS_IN_SET(['blue','red','yellow'])), Field('order'))
## That works fine
db.table1.order.show_if = (db.table1.colour=='red')
#that doesn't work returning error " 'Query' object has no attribute
'tablename'"
db.table1.order.show_if = (db.table1.colour=='red') |
(db.table1.colour=='blue')
form=SQLFORM(db.table1)
Any ideas?
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.