follow up query1 or query2 IS INVALID SYNTAX query1|query2 IS CORRECT
"or" cannot be overwritten in Python so it is still valid but it does not do what you want. query1 or query2 ALWAYS returns just query1. Massimo On Jun 18, 10:43 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > query1 and query2 IS INVALID SYNTAX > query1&query2 IS CORRECT > > "and" cannot be overwritten in Python so it is still valid but it does > not do what you want. > query1 and query2 ALWAYS returns just query2. > > Massimo > > On Jun 18, 8:58 am, weheh <richard_gor...@verizon.net> wrote: > > > I'm using web2py 1.64.1. I'm seeing a strange behavior in my query. > > I'm trying to isolate a record using a compound "and" clause ... very > > simple stuff: > > > records = db( (db.x.a == i) and (db.x.b==0) and (db.x.c==None) > > and ...).select(db.x.ALL) > > > But, it returns a whole bunch of records that have nothing to do with > > my match criteria. > > > I redid the search with an "or" clause instead, (don't ask me why I > > did this 'cause it makes no sense to me): > > > records = db( (db.x.a == i) or (db.x.b==0) or (db.x.c==None) > > or ...).select(db.x.ALL) > > > and believe it or not, this works fine. I think I'm going nuts! Why > > should this work? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---