On Mon, 22 Apr 2019 at 20:10, Mike Bayer <clas...@zzzcomputing.com> 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, EmployeeAssociation, and PartTimeAssociation.   You
would find things work pretty automatically in that style.  alternatively
you can use custom join conditions on each relationship.     There are even
ways you can programmatically build up these classes and relationships
based on the items available 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 post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to