Re: [sqlalchemy] Double many-to-many relation filter headache

2012-10-02 Thread Michael Bayer
On Oct 2, 2012, at 6:28 AM, Vlad K. wrote: On 10/01/2012 04:48 PM, Michael Bayer wrote: If I understand correctly, this isn't accurate. Your query needs the usage of query.join(), and this usage is not related to whether or not you supply a complete entity to select from. I wasn't

Re: [sqlalchemy] Double many-to-many relation filter headache

2012-10-01 Thread Vlad K.
To answer my own question, seems like SQLA won't automatically process inner joins if you supply individual columns to the session.query(), if had to pass the declarative model class itself for this to work as expected. Unless I'm doing something wrong, I guess I should use deferred columns

Re: [sqlalchemy] Double many-to-many relation filter headache

2012-10-01 Thread Michael Bayer
On Oct 1, 2012, at 7:21 AM, Vlad K. wrote: To answer my own question, seems like SQLA won't automatically process inner joins if you supply individual columns to the session.query(), if had to pass the declarative model class itself for this to work as expected. If I understand

[sqlalchemy] Double many-to-many relation filter headache

2012-09-28 Thread Vlad K.
Hello list, I don't think my brain is currently capable of figuring out the SQL itself, let alone how to do it with SQLA. I've got the following models: City Location Item Category Location belongs to one of many Cities via simple Location.city_id foreign key Location belongs to one or