Hi,

Just a easy question, why we don't have a contains_eager_all like we do with
joinedload?

By the way, I don't exactly understand why we shouldn't use the _all version
always.

Example (from
http://www.sqlalchemy.org/docs/orm/loading.html?highlight=contains_eager#contains-eager
):

query(User).options(contains_eager('orders', 'items'))


With this we are only loading the items of the orders objects. But to access
it, I must pass through the orders relation anyway, but without another:

contains_eager('orders')


It would make a new select, so I didn't get whats the use case of eager
loading the deepest children without loading all the way to it too.


(or maybe I'm wrong and it's behavior is like what I said and I'm missing
something in my tests)

Thanks in advance,


------

Bonus question: Wouldnt be nice if the joinedload (and all the variants)
could be used in the Query object? Ex:

query(User).joinedload('orders').all() is much more readable than:
query(User).options(joinedload('orders').all()

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

Reply via email to