Hi Richard,

On 25/04/13 15:35, Richard Vézina wrote:
I think your mistake is the following :

db(where clauses).select(tables and join)


I've not seen it summarised quite like that before - very helpful, thank you.

I've got a bit of a mental block about this (as evidenced by the fact that when I Googled the problem I found my own mails asking almost the same question a couple of years ago!), and have tended to fire up dBVis and knock up a view in its visual designer.


So your query should read like this :

rows=db(WHERE CLAUSE IF YOU HAVE SOME OTHER THAN THE
JOIN).select(db.parent.ALL, db.child.ALL, db.grandchild.ALL,
join=db.child.on(db.child.__parent_id==db.parent.id
<http://db.parent.id/>), left=db.grandchild.on(db.__child.id
<http://db.child.id/>==db.grandchild.child___id))


I applied that to my actual tables, and am getting the expected results now - thanks again.



--

Regards,

PhilK


'a bell is a cup...until it is struck'

--

--- 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/groups/opt_out.


Reply via email to