Skip to content

Instantly share code, notes, and snippets.

@st4lk
Created October 24, 2012 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st4lk/3944516 to your computer and use it in GitHub Desktop.
Save st4lk/3944516 to your computer and use it in GitHub Desktop.
Python: sqlalchemy query filter
from config import Session
from models import Person
session = Session()
persons = session.query(Person).filter(Person.name == u"Василий Пупкин", Person.status == STATUS.employer)
persons = session.query(Person).filter(Person.info.like(u"%Веб%"))
for person in persons:
print person.link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment