Re: [sqlalchemy] mixins vs single table inheritence

2010-04-08 Thread Chris Withers
Michael Bayer wrote: are you wondering*why* this happens ? its because your mixin is giving all classes a __tablename__. Well, that's only a symptom of the problem, here's another example: def test_mapper_args_single_table(self): class CommonColumns: id = Column(

Re: [sqlalchemy] mixins vs single table inheritence

2010-04-08 Thread Michael Bayer
Chris Withers wrote: > Hi Again, > > So here's a test case ready to drop onto the end of test_declarative.py: > > def test_mapper_args_single_table(self): > > class TableNameMixin: > @classproperty > def __tablename__(cls): > return cls.__nam

[sqlalchemy] mixins vs single table inheritence

2010-04-08 Thread Chris Withers
Hi Again, So here's a test case ready to drop onto the end of test_declarative.py: def test_mapper_args_single_table(self): class TableNameMixin: @classproperty def __tablename__(cls): return cls.__name__.lower() class CommonColumns: