[sqlalchemy] Binding params in text query with orm attributes

2014-01-23 Thread Chung
Hi all, Suppose I have a text query like: # intentionally arbitrary string textquery = SELECT count(*) FROM Address a WHERE a.user_id = :user_id And I'm trying to incorporate it into an ORM query on a table User, counting the number of Users with an Address, roughly like so: # wrong!

Re: [sqlalchemy] Binding params in text query with orm attributes

2014-01-23 Thread Michael Bayer
On Jan 23, 2014, at 9:06 PM, Chung chun...@gmail.com wrote: Hi all, Suppose I have a text query like: # intentionally arbitrary string textquery = SELECT count(*) FROM Address a WHERE a.user_id = :user_id And I'm trying to incorporate it into an ORM query on a table User, counting