Created
October 24, 2012 07:15
-
-
Save st4lk/3944516 to your computer and use it in GitHub Desktop.
Python: sqlalchemy query filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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