Folks:
I'm trying to achieve the following.
I have a legacy table (Parent), which has a good foreign key to a tiny
table that complements it (Child).
For the use case, querying Parent without joining with Child is not
meaningful.
class Child(Base):
__tablename__ = "child"
id =
e, you need to select from TableA and TableB explicitly and write
> the UNION directly.
>
> if this in fact a "toy" example then I would say you're better off not
> using concrete inheritance as it is not very fluent.
>
>
>
>
> On Tue, Jan 7, 2020, at 1:38 PM,
Folks I have this toy example I've sanitized.
class TableBase(AbstractConcreteBase, Base):
pass
class TableA(TableBase):
__tablename__ = "table_a"
__mapper_args__ = {
"polymorphic_identity": "A",
"concrete": True,
}
v0 = Column(Integer)
@hybrid_property