[web2py] Re: Query a join tables SQLFORM.smartgrid

2019-08-26 Thread Gilad Hoshmand
smart_grid = SQLFORM.smartgrid(db.child, left = (db.parent.on(db.child.parent_id* & (db.parent.field_bla == some_value)*), ...other settings...) On Sunday, August 25, 2019 at 3:44:47 PM UTC+3, Gilad Hosh

[web2py] Query a join tables SQLFORM.smartgrid

2019-08-25 Thread Gilad Hoshmand
I'm trying to make a smartgrid from 2 tables and apply a query to it. I've tried all the following: smart_grid = SQLFORM.smartgrid(db.child, left = (db.parent.on(db.child. parent_id), # keywords = (db.fa_defect_

[web2py] Re: How to create wrapper / decorator functions

2019-06-17 Thread Gilad Hoshmand
This is the answer: Call /controller/wrapper_func1/arg1/arg2 def wrapper_func1(): get args... response.view = "path/to/main_page.html" return generalFunc(..args..) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/

[web2py] How to create wrapper / decorator functions

2019-06-17 Thread Gilad Hoshmand
Hi I'm trying to create wrapper/decorator functions like so: The view to load is the same html file every time, the args need to be different. I can pass arguments using request.args[0] etc. but it seems dirty and I prefer to separate and handle pre-processing the data (according to args) in t

[web2py] Re: conditional {{include}} in view

2019-06-04 Thread Gilad Hoshmand
For those who arrive late, from the docs : {{if some_condition:}}{{include 'this_view.html'}}{{else:}}{{include 'that_view.html'}}{{pass}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gi

[web2py] Re: gluon.contrib.pymysql.err.Error AssertionError('Protocol error, expecting EOF',)

2019-05-14 Thread Gilad Hoshmand
Solved. The problem was that I was addressing 'single_value_field' without the context of the derived table. Changed: JOIN table2 ON (table2.id = single_value_field) To: JOIN table2 ON (table2.id = *new_table_alias*.single_value_field) On Monday, May 13, 2019 at 6:14:08 PM UT

[web2py] gluon.contrib.pymysql.err.Error AssertionError('Protocol error, expecting EOF',)

2019-05-13 Thread Gilad Hoshmand
Hi all, I built a join query which breaks up a field that has '|' char as separator of values to multiple rows with single values (ie. field value = '1|2|3' , rows will be multiplied with single_value_field = 1 , single_value_field = 2 etc..) Filters some rows ('Having ... ' ) Then join with a

[web2py] Re: Error: Exporting CSV file in SQLFORM.grid

2019-03-12 Thread gilad
Could you share your solution? On Wednesday, January 14, 2015 at 7:31:56 PM UTC+2, Prasad Muley wrote: > > Hello All, > >I've used a SQLFORM.grid for displaying table content. I've > provided export to CSV option in grid. > > My app settings are as below: > > *models/db.py* > > db.define_