1. Mike Bayer
  2. sqlalchemy

Commits

Charles-Axel Dein  committed c5005f7

Add is_ and isnot filter to the tutorial

Most linter complain when comparing with None.

  • Participants
  • Parent commits 987759a
  • Branches rel_0_8

Comments (0)

Files changed (1)

File doc/build/orm/tutorial.rst

View file
 
     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_