Re: [sqlalchemy] On query level overriding multi tentant setup

2014-03-10 Thread sjoerd
Thanks! On Thursday, March 6, 2014 7:21:49 PM UTC+1, Michael Bayer wrote: I don’t use Flask but this is the reason I don’t really like the whole Model.query thing. If you query from your Session, there’s no issue. The Session should be determining the nature of the query. That said,

[sqlalchemy] On query level overriding multi tentant setup

2014-03-06 Thread sjoerd
Hai, I have a multitenancy flask and sqlalchemy application. Models I have given an extra column client_id and a custom query_class. This query_class then automatically filters on the client_id stored in the session. Works like a charm! But now, I want to build a second flask application that

Re: [sqlalchemy] On query level overriding multi tentant setup

2014-03-06 Thread Michael Bayer
I don't use Flask but this is the reason I don't really like the whole Model.query thing. If you query from your Session, there's no issue. The Session should be determining the nature of the query. That said, Model.query is going to be ultimately calling session.query() anyway, so I think