Hi all,

I'm having an issue where I'm doing a query that I want to be loaded
all in one select to the database.  I have a table "ContentLeaf" which
inherits from "Content", I can get the ContentLeaf fields to eagerload
by using select_table in the mapper:

    myjoin = content_table.outerjoin(content_leaf)
    cm = mapper(Content, content_table,
           select_table = myjoin,
           properties = {
            'account'    : relation(Account, cascade='all',
lazy=False),

Here I also define the account property to eagerload by specifying
lazy=False.  In this case, only the ContentLeaf eagerloads and I see
this in the debug logs:

DEBUG:sqlalchemy.orm.strategies.EagerLoader:Could not locate aliased
clauses for key: (<sqlalchemy.orm.mapper.Mapper object at 0x2d95850>,
'account')
DEBUG:sqlalchemy.orm.strategies.EagerLoader:eager loader Mapper|
Content|content.account degrading to lazy loader

If I remove the select_table, the account property will then
eagerload, but I really want both to eagerload in the same query.  Any
ideas on how to make this happen?

thx

Matt

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