Re: [sqlalchemy] Querying an Association Proxy using an enum column in the intermediate table

2019-04-22 Thread Jason Armstrong
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,

Re: [sqlalchemy] Querying an Association Proxy using an enum column in the intermediate table

2019-04-22 Thread Mike Bayer
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"

[sqlalchemy] Querying an Association Proxy using an enum column in the intermediate table

2019-04-21 Thread Jason Armstrong
Hello everyone, I am modelling a relationship between two groups which is a many-to-many relationship, with an additional constraint. I have an Employer and a Worker class. Employers can have a relationship to a worker in a number of ways, which I'm representing by an enum: Contractor,