[sqlalchemy] Automatically use value from a lookup table

2019-04-07 Thread Yuval Dinari
Hi, I have a lookup/reference table which associate several fixed names to unique ids (like an enum type). Those ids are used elsewhere as foreign keys. It would be nice to somehow state that relationship, then in my python code create a column in the child table, put in there a value which will

Re: [sqlalchemy] Automatically use value from a lookup table

2019-04-07 Thread Mike Bayer
Setting an object value from a string is straightforward, this is done using association proxy: https://docs.sqlalchemy.org/en/latest/orm/extensions/associationproxy.html Getting this object value from an existing set of objects in the database is not as easy, because this requires a database