On 2014-03-26 18:16, Michael Bayer wrote:
> It's not totally clear which of the common use cases you have here, pick one:
> 
> 1. I want to emit a JOIN from User to Car and order by Car.model - don't use 
> eager loading, use query.join(): 

This one.

> http://docs.sqlalchemy.org/en/rel_0_9/faq.html#i-m-using-joinedload-or-lazy-false-to-create-a-join-outer-join-and-sqlalchemy-is-not-constructing-the-correct-query-when-i-try-to-add-a-where-order-by-limit-etc-which-relies-upon-the-outer-join

Ok but this will result in duplicate joins, right? It does not look too
efficient, does it?

It was discussed here:
http://stackoverflow.com/questions/22490777/sqlalchemy-how-to-order-query-results-order-by-on-a-relationships-field-re
. I spotted duplicate joins, which I wanted to avoid, and was advised to
use options(contains_eager(...)).

Is there any better way to get rid of those duplicate joins? Or are we
supposed to live with it?

-- 
http://people.eisenbits.com/~stf/
http://www.eisenbits.com/

OpenPGP: 80FC 1824 2EA4 9223 A986  DB4E 934E FEA0 F492 A63B

-- 
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