[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-03-03 Thread Ramkrishan Bhatt
Thanks Man, Working fine with me. On Monday, 2 March 2015 03:25:22 UTC+5:30, Leonel Câmara wrote: > > Turns out you're right, here's a possible workaround: > > def register(): > db.purchase.coupon_code.show_if = (db.purchase.have_coupon == > 'Individual') > > form=SQLFORM.factory(db.cli

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-03-01 Thread Leonel Câmara
Turns out you're right, here's a possible workaround: def register(): db.purchase.coupon_code.show_if = (db.purchase.have_coupon == 'Individual') form=SQLFORM.factory(db.client,db.address,db.purchase) form.element(_id='no_table_coupon_code')['_data-show-trigger'] = 'no_table_have_co

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-03-01 Thread Ramkrishan Bhatt
Ya why don't you try your self with SQLFORM and SQLFORM.factory with multiple tables. Than use show_if than you will get it what I want. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/i

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-28 Thread Leonel Câmara
Did you include those fields in the factory? -- 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 G

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-28 Thread Ramkrishan Bhatt
Its working fine with SQLFORM() but its not working with SQLFORM.factory() -- 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 beca

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-28 Thread Ramkrishan Bhatt
db.purchase.coupon_code.show_if = (db.purchase.have_coupon=='Individual') -- 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 becau

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-28 Thread Ramkrishan Bhatt
Sorry syntax mistack it was show_if=='Individual' -- 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

[web2py] Re: show_if is not working with SQLFORM.factory multitable

2015-02-27 Thread Leonel Câmara
I don't usually use show_if but I'm guessing it's because a db.purchase.have_coupon is not == to True. Which makes sense since it's a string. You can test in the python interpreter 'abc' == True, the result will be False. The correct form would be: db.purchase.coupon_code.show_if = (db.purch