'Python, SQLAlchemy cascade - save-update
I would like to ask if it is possible to update the Child records automatically when Parent is changing in a one-to-many relationship.
For example; I have a task list for every project at the company:
Project 1 (Parent table)
-> Project 1 - Task1 (Child table)
-> Project 1 - Task2
-> Project 1 - Task3
Project2
-> Project 2 - Task1
-> Project 2 - Task2
-> Project 2 - Task3
I want to change the project name from "Project 1" to "Project First" in the Parent table. How can I achieve to update the name of the project in the Child table as well?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|