Hi All,

I've got a fairly complicated object structure for which I'm building
a tree type object. The first level of the tree is a polymorphic
relation with three subclasses. Two of those subclasses are fairly
straightforward, but the 3rd points to another class with subclasses.
I would like to be able to query this 3rd type of object and have the
different types of object returned from the query be prepopulated with
their various different attributes so that I can do:

row1.object.attribute1
row2.object.some_other_attribute

In the above cases 'object' will be one of several different
subclasses so that attribute1 and some_other_attribute don't exist on
both subclasses. I'd like for this attribute access to not hit the
database as far as possible. So I'm, basically looking for a way to
load the whole object graph from the parent in one hit.

I've tried various flavours of eagerload join and outerjoin on the
query, but I'm not even sure if I'm on the right track or not. At this
stage I'm just looking for general pointers so I haven't put up any
code for the classes and mappers concerned, if it would help I could
try and distil what I've got into something illustrative.

TIA
Ben
-- 
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.


Reply via email to