[sqlalchemy] Re: Sqlalchemy ORM operates on database not created from sqlalchemy

2014-01-23 Thread Jonathan Vanasco
Just to rephrase everyone else's It doesn't matter response: Many ORMs out there REQUIRE the database be built by the ORM or designed by the ORM. This is because the ORM stores and accesses data in a very particular manner -- so tables and columns must adhere to certain naming conventions,

Re: [sqlalchemy] Relationship with complicated join conditions

2014-01-23 Thread Simon King
On Thu, Jan 23, 2014 at 1:45 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 22, 2014, at 7:17 PM, Simon King si...@simonking.org.uk wrote: I read the bit in the docs about non-primary mappers but was scared off by the almost never needed warnings. Actually, for the purposes I'm

Re: [sqlalchemy] Relationship with complicated join conditions

2014-01-23 Thread Michael Bayer
On Jan 23, 2014, at 2:07 PM, Simon King si...@simonking.org.uk wrote: That's fantastic, thanks so much. I feel bad that my silly use case has caused so much work for you and grown the docs even more (perhaps you need a separate Tricks for People who Should Know Better section) oh but this

[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