Here is an update to the original that now works, implementing Mike's
solution of a single table inheritance for the association object.
Thank you again!
from sqlalchemy import Column, ForeignKey, Enum, Text, Integer,
create_engine
from sqlalchemy.orm import relationship, backref,
On Mon, 22 Apr 2019 at 20:10, Mike Bayer wrote:
> So the architecture here should instead use three relationships, and to
make it automatically handle the enumeration you can use a single table
inheritance pattern on your association object, meaning you would have
ContractorAssociation,
I'm on mobile at the moment but currently while your code embeds an
appropriate creational pattern into each association proxy, that has no
bearing upon the objects that each proxy returns, since they are all
proxying the same collection which contains everything. The reason it's
called a "proxy"
Hello,
How to reload data from table/all tables using sqlalchemy ORM?
Thanks
Jano
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See
> class T2(Base):
> __table__ = Table("t2", Base.metadata, autoload_with=session.connection())
> __mapper_args__ = {
> "primary_key": [__table__.c.source_file] # a primary key must
> be determined
> }
A variant of this software design approach can work also for my data