- changed status to duplicate
using an __abstract__ interferes with declarative determining inherits
Issue #3240
resolved
from sqlalchemy import Integer, Column, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
class AAbs(A):
__abstract__ = True
class B1(A):
__tablename__ = 'b1'
id = Column(ForeignKey('a.id'), primary_key=True)
class B2(AAbs):
__tablename__ = 'b2'
id = Column(ForeignKey('a.id'), primary_key=True)
assert B1.__mapper__.inherits is A.__mapper__ # passes
assert B2.__mapper__.inherits is A.__mapper__ # fails
Comments (3)
-
reporter -
reporter this is a dupe of
#3219as that patch addresses this. -
reporter - changed status to resolved
- Fixed bug where using an
__abstract__
mixin in the middle of a declarative inheritance hierarchy would prevent attributes and configuration being correctly propagated from the base class to the inheriting class. fixes#3219fixes#3240
→ <<cset 95e53d0b6072>>
- Log in to comment
Duplicate of
#3219.