this is not really a built-in SQLAlchemy feature so the quick thing I can 
advise is to use subqueryload() instead, which makes use of Query to get at the 
related "pets" collection, rather than appending to the query directly as 
joinedload does.  Your other option would be to use a custom primaryjoin on 
User.pets that adds in "deleted=null" to the criterion, which joinedload would 
make use of.


On May 2, 2012, at 10:34 AM, Andrei Chirila wrote:

> Hello,
> 
> A couple of months ago I was asking on the list about a query class that 
> could support a "deleted_at" attribute for the models, such as when a object 
> it's deleted, the statement it's transformed into an update with the field 
> set to a certain date. Just now I noticed that my class is not friendly with 
> joinedload. That is, when doing a query with options(joinedload(...)), the 
> collection doesn't get the "deleted_at" filter. Is there any (exposed) way of 
> accessing all the entities involved in a query (through options and 
> <TYPE>load)?
> 
> Minimal code example at: http://pastie.org/3848978
> 
> Thank you,
> Andrei Chirila
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to