Q:

SQLAlchemy equivalent to Django's x.objects.extra()?

I just learned of django's (model).objects.extra() function, as documented:
http://docs.djangoproject.com/en/1.2/ref/models/querysets/#extra
I'm hoping that there is something similar in sqlalchemy.  I would like to be able to have the flexibility of raw sql through the cursor, but still have my results come back through the ORM.  
Can you force SQL code into your query? (I'm using declarative base by the way)
Thanks in advance

A:

I think you're looking for Query.from_statement: http://www.sqlalchemy.org/docs/orm/query.html#sqlalchemy.orm.query.Query.from_statement

