-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugSomething isn't workingSomething isn't workingdeclarativehas to do with the declarative API, scanning classes and mixins for attributes to be mappedhas to do with the declarative API, scanning classes and mixins for attributes to be mappedlow priority
Milestone
Description
Migrated issue, originally created by Victor Olex (@agilevic)
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'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdeclarativehas to do with the declarative API, scanning classes and mixins for attributes to be mappedhas to do with the declarative API, scanning classes and mixins for attributes to be mappedlow priority