[sqlalchemy] association_proxy

2020-03-13 Thread Damian Yurzola
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 =

Re: [sqlalchemy] Concrete inheritance with different hybrid methods

2020-01-08 Thread Damian Yurzola
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,

[sqlalchemy] Concrete inheritance with different hybrid methods

2020-01-07 Thread Damian Yurzola
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