When I do a query like this

result = session.query(A).\
join(A.bs).\
join(B.cs).\
filter_by(C.somedata.in_([4455, 4466])).\
options(contains_eager(A.bs).contains_eager(B.cs)).one()

and list related C objects

for b in result.bs:
   b.cs

I get all related to B C objects instead of only those with 4455, 4466 
values - even though I filtered the output of the statement.

So eager loading when used with contains_eager() - as I understand - 
shouldn't load other related objects apart from those which are selected by 
statement. Still I get Cs with values other that 4455, 4466(i.e. all the 
collection) :( Could any suggest from where come other Cs? Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to