[web2py] Re: getting confused when running select on joined tables

2015-11-16 Thread Red Beard
Hey, My answer won't answer your question directly - but Massimo made some amazing videos which I came across the other day: https://vimeo.com/album/3016728 - check out no.10 and 11 for details on the DAL he goes into detail about queries etc. Being a complete beginner they have really helped

[web2py] Re: getting confused when running select on joined tables

2015-11-15 Thread Edward Shave
Nearly forgot to come back, sorry for delay... Switching "&" for "and" fixed my immediate problem and as usual I learnt more interesting stuff from your answer. Many thanks Ed -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: getting confused when running select on joined tables

2015-11-15 Thread Anthony
> In a DAL query, you must use & rather than and. By using the latter, you > are getting the standard Python behavior, whereby x and y simply yeilds y. > Just to be clear, if x evaluates to a falsey value (e.g., 0, '', []), then x and y instead yields x. Anthony -- Resources: -

[web2py] Re: getting confused when running select on joined tables

2015-11-14 Thread Anthony
> >>> row2=db((db.entry.acc_id==db.acc.id) and (db.entry.txn_id==1)).select > ().first() > In a DAL query, you must use & rather than and. By using the latter, you are getting the standard Python behavior, whereby x and y simply yeilds y. So, in this case, your query is equivalent to simply