care to show an example ?
db.define_table('purchase', Field('have_coupon','integer', default=1),Field(
'coupon_code'))
def index():
db.purchase.coupon_code.show_if = (db.purchase.have_coupon==1)
form = SQLFORM(db.purchase).process()
return dict(form = form)
works totally fine.
On Friday, November 7, 2014 11:23:52 PM UTC+1, DenesL wrote:
>
> While reviewing another post (
> https://groups.google.com/forum/#!topic/web2py/1UOl694VtIs )
> I noticed that the code generated for the show_if does not work when the
> field is integer and the value is 1
> since the data-show-if attribute is set to ":checked" and not
> "[value='1']" as it should be.
>
> It is probably something in the show_if function of gluon/sqlhtml.py
> relating to the truthness of the value 1.
>
> One for the bug hunters.
>
> Denes
>
--
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.