Re: [sqlalchemy] generalized polymorphic mixin

2011-01-26 Thread Michael Bayer
well it will "work" if you say this: class PolymorphicMixin(object): discriminator = Column('discriminator', types.String(50)) @declared_attr def __mapper_args__(cls): ret = {'polymorphic_identity': cls.__name__} if Base in cls.__bases__: ret['polymorphic_on

[sqlalchemy] generalized polymorphic mixin

2011-01-26 Thread scott
Is it possible to make a generalized declarative mixin class that abstracts away all of the syntax of inheritance? I've seen examples that set up the __mapper_args__ but not the discriminator column, and examples that set up the discriminator column but not the __mapper_args__, but none with both.