On Sun, May 2, 2021, at 4:44 PM, Richard Damon wrote:
> I asked this a bit ago, but never got an answer, so trying again wording
> a bit different to see if I can get help.

sorry if this got missed.

> 
> The question is, given an existing record for an 'Employee', how to I
> change it from an Employee to say an Engineer. I don't want to make a
> 'new' record with a new ID number, as the id number is referenced in
> other tables.
> 
> 
> Not using ORM, it would be a simple matter of writing the data into the
> Engineer table with an INSERT, forcing the ID to match the ID of the
> employee, and then change the value of the type field in the Employee
> table with an UPDATE. The question is, is there a more "ORM' way to do this?

this request comes up from time to time however the Core method you refer 
towards is the best way to do this.    This kind of operation is unusual enough 
that it's simpler for users to write the Core routine they want for their needs 
rather than adding a complex generalized feature to the ORM that would not be 
used often and would be difficult to develop and support.



> 
> 
> 
> -- 
> Richard Damon
> 
> -- 
> 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 
> <mailto:sqlalchemy%2Bunsubscribe%40googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/c7b852a4-8d94-6341-c1ad-376051244059%40Damon-Family.org.
> 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/fbb453bc-31ce-4d24-86ea-770a1df56b56%40www.fastmail.com.

Reply via email to