Query a join tables SQLFORM.smartgrid

36 views
Skip to first unread message

Gilad Hoshmand

unread,
Aug 25, 2019, 8:44:47 AM8/25/19
to web...@googlegroups.com
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.parent.field_bla == some_value),
                                       
# constraints = {'parent': (db.parent.field_bla == some_value)},
                                       
...other settings...)

I've tried joining the other way around, using 'constraints' in many ways, keywords, query instead of table. None of these worked.

Gilad Hoshmand

unread,
Aug 26, 2019, 7:31:05 AM8/26/19
to web...@googlegroups.com
The answer(not in the book):

        smart_grid = SQLFORM.smartgrid(db.child,
                                       left
= (db.parent.on(db.child.parent_id & (db.parent.field_bla == some_value)),
                                       
...other settings...)


Reply all
Reply to author
Forward
0 new messages