On Jun 24, 2010, at 10:23 PM, Nicholas Bower wrote: > > eagerload() doesn't do anything with the existing joins or filter criterion > you have, it specifically generates its own joins that will load everything > that is logically part of the SwathMetadata.productfile relationship, which > here is a one-to-many. The purpose here is to separate the concern of > populating a collection from that of the filtering/joining intended to locate > the primary object rows. > > Ok well that explains it. The "decoupling" is intended then. > > > Here, you'd like the joins and such that you've spelled out manually to also > result in the population of SwathMetadata.productfile, limiting the > collection to only those items selected by your joins. For this purpose, > use the contains_eager() option, introduced in the ORM tutorial at: > > http://www.sqlalchemy.org/docs/ormtutorial.html?#using-join-to-eagerly-load-collections-attributes > (note joinedload() is the same as eagerload() in 0.5) > > Aha! Am I right in thinking this is 0.6.x only?
contains_eager() has been around for awhile since 0.5 at least. 0.6 has some name changes regarding eager and a new feature "subqueryload", but otherwise 0.5 has all the same features. > > Thanks, Nick > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@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. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.