Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created May 6, 2011 11:01
Show Gist options
  • Save lxneng/958756 to your computer and use it in GitHub Desktop.
Save lxneng/958756 to your computer and use it in GitHub Desktop.
from sqlalchemy import not_
session.query(Region).filter(not_(Region.id.in_( (1,2,3) )))
alternately,
session.query(Region).filter(~ Region.id.in_( (1,2,3) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment