> I don't have the time most of today to get into it so I can't confirm > what's going on. Any chance you could map to a straight join of all four > tables instead of a join to two sub-joins ?
I tried the following join in the mapper for Subordinate: join(Employee, Person).join(Relation, onclause=Person.id==Relation.person_from_id).join(SupervisorRelation) I also tried using single-table inheritance in order to avoid sub- joins. The results were the same - trying to select from a non-existing sequnce. This time it's the sequence for the other object, so I guess both are firing wrong, the exact error depends on which one is firing first. I could use MapperExtension.before_insert() as you suggested. However, since rows are inserted first in parent table then in child table, I would need to know that next primary key value and set the id to it. But selecting from a sequnce causes it to increment, and the parent and child primary keys will fail to be in sync. I would need to somehow set the primary key after the parent object has been inserted but before the child is inserted, and I don't know how to accomplish that. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
