I can't figure out any good way to phrase my question without some
pipe-laying, so here I go...

I have a pattern of doing some various query activities in my app that
ultimately result in retrieving a single instance of one of my mapped
classes from the ORM. So naturally I stuck that pattern in a function,
which I pass my session object, a class, and some other parameters and
it either hands me an instance or raises exceptions. The point here is
that I never see a Query object if I use this function.

So, now suppose I have my instance (call it "obj") and it has a 1-M
relation, obj.rel, to a class Secondary. Secondary is in turn related
(1-1 in this case) to Tertiary.

If I start iterating over the obj.rel collection and access the Tertiary
objects, I get O(n) behavior as one would expect. Is it possible to set
up an eager-load of the Tertiary relation from *here*, after the Query
is long gone? I would love to avoid tangling "should I eager-load or
not" logic into the instance-fetching function, just for these one or
two cases.

-Kyle

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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