I have a pretty simple case. A base class with three sub-classes, and then
a final class that inherits from the three derived classes. When
persisting, sqlalchemy only sets the properties of the parent class and the
first child class.
In all other respects the sub-class is behaving properly;
The inheritance mechanics don't support multiple inheritance from the POV of
multiple mapped classes as the base for another mapped class. Single table
inheritance would be the easiest case to work at some point, but there's lots
of mechanics in place right now that assume a linear path from
and if you expand upon this approach you'll probably have column conflicts too,
refer to
http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/declarative.html#resolving-column-conflicts
for the strategy for dealing with that.
On Jan 14, 2013, at 1:17 PM, Michael Bayer wrote:
The inheritance
I am all down with the power of mixins. The reason I mapped things this way
is because I do have concrete instances of string, amount, and quantity.
(I'm capturing data from receipts: string can be e.g. a receipt number,
amount can be e.g. a total, and quantity can be something unaffiliated
I agree this could be better. Not sure how deep we'd have to go to get
multiple inheritance in single inheritance form to work, mapping to inheritance
hierarchies is probably what adds most complexity to the ORM as it is. It's a
very rare use case though, and also gets way harder when we