the eager load queries are not meant to be modified by the query that
you send to query.select()....youre not really supposed to have any
awareness of the eager loads at all.  eager loading and lazy loading
both load the full list of child items in all cases.  heres a relevant
FAQ entry:

http://www.sqlalchemy.org/trac/wiki/FAQ#ImusinglazyFalsetocreateaJOIN/OUTERJOINandSQLAlchemyisnotconstructingthequerywhenItrytoaddaWHEREORDERBYLIMITetc.whichreliesupontheOUTERJOIN

heres a new section in the docs that illustrates how to load relations
only partially (though lazily):

http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_working

if you totally want to eagerly load the child items using a specialized
criterion, this would be a job for result set mapping, where you make
whatever query you want.  the basic idea is described here:

http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_working

however, i need to update those docs.  to get the eager loads in your
query to work, you need to send along some special information about
which relations you are eager loading in your query, like this:

q = session.query(SomeClass).options(contains_eager('somerelation'),
contains_eager('someotherrelation'))
result = q.instances(myselectstatement.execute())


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to