On Wednesday, January 4, 2017 at 1:28:28 PM UTC-8, backseat wrote: > > My PEP8 checker tells me that: > > db.table.field == None > > should be > > db.table.field is None > > But that doesn't evaluate correctly. Why? > > (I did search for this but couldn't find it discussed before: apologies if > I missed it). > > Thanks >
Here's where I got clued in: <URL:https://groups.google.com/d/msg/web2py/Hayy_ANLYtY/VwbSRGvhEAAJ> In the book, there's *Query* is an object that represents a SQL "where" clause: > > 1 > > myquery = (db.mytable.myfield != None) | (db.mytable.myfield > 'A') > > <URL:http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#The-DAL--A-quick-tour> and You can even build a query (using operators like ==, !=, <, >, <=, >=, > like, belongs) and store the query in a variable q such as in: > > 1 > > >>> q = name == 'Alex' > > <URL:http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Query--Set--Rows> /dps "it's a learning process" -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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/d/optout.

