Richard Damon
unread,Apr 16, 2021, 9:26:33 PM4/16/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
Using SQLAlchemy 1.4 latest, intending to keep upgrading and moving to 2.x
Using ORM with Joined Table Inheritance.
Have an object in the database as an instance of the base class, which
has a lot of data in it, and want to upgrade it to be an instance of
derived class. So in the examples, promote an plain Employee to be an
Engineer or a Manager.
If not using ORM and willing to just duplicate code, I would just write
the new data to the associated derived table and then change the type
field in the base table, but this seem 'crude'. Is there a better way to
let me use the ORM structures to actually do some of the work?
I don't think I can just create a new derived object with the original
primary key, as that will get rejected as a duplicate key, not replace
the object.
--
Richard Damon