]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add is_ and isnot filter to the tutorial
authorCharles-Axel Dein <ca@d3in.org>
Sat, 15 Mar 2014 00:40:04 +0000 (17:40 -0700)
committerCharles-Axel Dein <ca@d3in.org>
Sat, 15 Mar 2014 21:42:43 +0000 (14:42 -0700)
Most linter complain when comparing with None.

doc/build/orm/tutorial.rst

index 96cedc973f2358333402374571e278f17d2acb88..7fe43e200f0166869ae64be97965af380764b17e 100644 (file)
@@ -773,10 +773,16 @@ Here's a rundown of some of the most common operators used in
 
     query.filter(User.name == None)
 
+    # alternatively, if pep8/linters are a concern
+    query.filter(User.name.is_(None))
+
 * IS NOT NULL::
 
     query.filter(User.name != None)
 
+    # alternatively, if pep8/linters are a concern
+    query.filter(User.name.isnot(None))
+
 * AND::
 
     # use and_()