- changed status to resolved
bug in internal annotations of an "IN" clause, i.e. single table inheritance
Issue #1731
resolved
i.e. fails:
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
employee = sa.Table("employee", Base.metadata,
sa.Column("id", sa.Integer, primary_key=True),
sa.Column("type", sa.Integer, nullable=False))
class Employee(Base):
__table__ = employee
__mapper_args__ = {"polymorphic_identity": 0,
"polymorphic_on": employee.c.type}
class Engineer(Employee):
__mapper_args__ = {"polymorphic_identity": 1}
class Other(Base):
__tablename__ = "other"
# Fields
id = sa.Column(sa.Integer, primary_key=True)
engineer_id = sa.Column(sa.Integer,
sa.ForeignKey("employee.id"))
# Relations
engineer = orm.relation("Engineer")
print Other.engineer.has()
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
86df449c2b724341f3d3f322ad71252b287e1f12