[sqlalchemy] Re: condition on every query

2015-12-14 Thread Victor Uriarte
Just tried running the code you posted, but in my case it keeps using the default query_class (Query) instead of the "MyPrefulteredQuery". Not sure if there was a breaking change on SA since you posted this. On Tuesday, July 22, 2014 at 11:35:49 AM UTC-7, Meg Mitchell wrote: > > I had the same

[sqlalchemy] Re: condition on every query

2014-07-22 Thread mail
I had the same problem and decided to look into implementing a custom relationship like you suggested. I'll post what I have here in case anyone else has the same problem. :) The first thing I noticed was the query_class attribute on the RelationshipProperty class. If you don't want to impleme

[sqlalchemy] Re: condition on every query

2011-02-20 Thread robert
On Feb 20, 8:59 pm, Michael Bayer wrote: > the cleanest and most foolproof way is to join on relationships that have the > condition: > > related_non_deleted = relationship(Related, > primaryjoin=and_(Related.deleted==False, Related.foo_id==id), viewonly=True) I agree that the explicit approach