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

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

[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,

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

2019-04-22 Thread Jason Armstrong
ble in the enum, if that were a concern. Thanks for the tip. I thought I might be going about it the wrong way, and I'll have a go at implementing your suggestion. Regards, -- Jason Armstrong -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To p