How do I compare a DateTime column to now() in a query filter in SqlAlchemy?
- by Ben
I have a table with an 'expires' datetime column. I want to find all the items that have an 'expires' date earlier than now.
I've tried
session.query(Item).filter(Item.expires < now())
but it doesn't return anything regardless of the dates in the table.
I'm using PostgreSQL 8.4.
How do I do this comparison?