]> 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)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Mar 2014 21:28:05 +0000 (17:28 -0400)
Most linter complain when comparing with None.

doc/build/orm/tutorial.rst

index afbf05734aa4db80f041bf4a35193e68c4cab93d..9dd27c322df11f601b3abfc4fff6f7dccc2ed679 100644 (file)
@@ -790,10 +790,16 @@ Here's a rundown of some of the most common operators used in :func:`~sqlalchemy
 
     filter(User.name == None)
 
+    # alternatively, if pep8/linters are a concern
+    query.filter(User.name.is_(None))
+
 * IS NOT NULL::
 
     filter(User.name != None)
 
+    # alternatively, if pep8/linters are a concern
+    query.filter(User.name.isnot(None))
+
 * AND::
 
     from sqlalchemy import and_