- changed title to Table is not being created if __abstract__ = False
- edited description
Table is not being created if __abstract__ = False
Issue #3097
resolved
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer
Base = declarative_base()
class A(Base):
__tablename__ = 'atab'
id = Column(Integer, primary_key=True)
class B(Base):
__tablename__ = 'btab'
__abstract__ = True
id = Column(Integer, primary_key=True)
class C(Base):
__tablename__ = 'ctab'
__abstract__ = False
id = Column(Integer, primary_key=True)
table_names = Base.metadata.tables.keys()
assert 'atab' in table_names, 'atab not found, this table has not __abstract__ property'
assert 'btab' not in table_names, 'btab found, but this table has __abstract__ = True'
assert 'ctab' in table_names, 'ctab not found, this table has __abstract__ = False'
Comments (6)
-
reporter -
repo owner - changed status to resolved
- Fixed bug when the declarative
__abstract__
flag was not being distinguished for when it was actually the valueFalse
. The__abstract__
flag needs to acutally evaluate to a True value at the level being tested. fixes#3097
→ <<cset ca58fa5d9338>>
-
repo owner - Fixed bug when the declarative
__abstract__
flag was not being distinguished for when it was actually the valueFalse
. The__abstract__
flag needs to acutally evaluate to a True value at the level being tested. fixes#3097
→ <<cset 2ad0ddca4c92>>
- Fixed bug when the declarative
-
repo owner thanks for this.
-
repo owner - changed milestone to 0.9.8
-
repo owner - changed milestone to 0.9.7
- Log in to comment