[Sqlalchemy-tickets] Issue #3097: Table not being create with __abstract__ = False (zzzeek/sqlalche
Brought to you by:
zzzeek
|
From: Victor O. <iss...@bi...> - 2014-06-25 15:03:21
|
New issue 3097: Table not being create with __abstract__ = False https://bitbucket.org/zzzeek/sqlalchemy/issue/3097/table-not-being-create-with-__abstract__ Victor Olex: ``` #!python 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' ``` |