On 29 Jan 2013, at 9:46 AM, Jonathan Lundell <[email protected]> wrote:
> On 29 Jan 2013, at 9:42 AM, Alan Etkin <[email protected]> wrote:
>> A similar caveat applies to the use of | or & in queries.
>> 
>> Ok, thanks for the tips Marin and Jonathan.
>> 
>> I assume then that the book's example should use parenthesis for negation, 
>> since web2py cannot change the Python operator precedence.
> 
> Yes. Instead of:
> 
> rows = db((~db.person.name=='Alex') | (db.person.id>3)).select()
> 
> it should read:
> 
> rows = db(~(db.person.name=='Alex') | (db.person.id>3)).select()
> 

I pushed a fix, along with adding a note to the existing note on operator 
precedence.

-- 

--- 
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