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

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

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

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