I’ve looked through the docs and I cant seem to find out how to do an OR query in SQLAlchemy. I just want to do this query.

SELECT address FROM addressbook WHERE city='boston' AND (lastname="bulger" OR firstname="whitey")

Should be something like

addr = session.query(AddressBook).filter(City == "boston").filter(????)

6 Answers
6

Leave a Reply

Your email address will not be published. Required fields are marked *