On Mon, Apr 28, 2008 at 10:33 PM, Michael Bayer <[EMAIL PROTECTED]> wrote:
> pjoin = polymorphic_union(...) > pjoin2 = polymorphic_union(...) > > employee_mapper = mapper(Employee, pjoin, polymorphic_on=pjoin.c.type) > manager_mapper = mapper(Manager, managers_table, > inherits=employee_mapper, concrete=True, polymorphic_identity='manager') > engineer_mapper = mapper(Engineer, engineers_table, > with_polymorphic=('*', pjoin2), > polymorphic_on=pjoin2.c.type, > inherits=employee_mapper, concrete=True, > polymorphic_identity='engineer') > hacker_mapper = mapper(Hacker, hackers_table, inherits=engineer_mapper, > concrete=True, polymorphic_identity='hacker') This solves nicely my "multi-level" problem, thanks ! > this should in theory also fix the "engineers" relation on Company. Doesn't seem to. Since I guess it's a bug, I've filed ticket 1018 for this. http://www.sqlalchemy.org/trac/ticket/1018 > But as I've said many times (to svil, at least) concrete inheritance > is something i havent gotten into much as of yet, largely due to the > many inherent issues with it as well as its being a generally > unpopular pattern, so there may still be issues with this setup (but > let me know, since thats how it "should" work). Ok, no worries. > In any case the unit tests which you were working from (im guessing > test/orm/inheritance/concrete.py) should be patched to include this > test (i.e. including Hacker, the polymorphic load, as well as the > relation). I'll add the working "multi-level" test this afternoon. I guess you don't want the relation part yet. > Assuming it works we should also make sure the 0.5 branch > (which isnt called that yet) can handle it too. -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---