Skip to content
Advertisement

how to update record and same record create in other table in django form

i have 2 model one is Tempdriver and other one is Hiring, i am register new customer in Tempdriver table, i need when i edit tempdriver record and status is (accept) and when i save this record then need to same record create on hiring table with matching column with status=(Applied on app) rest column should be null in hiring table

models.py

JavaScript

forms.py

JavaScript

views.py

JavaScript

Advertisement

Answer

First, let me to ask, why you use BaseModel instead of `models.Model’ ?(just for my information, i just wanted to ask in a comment, but i’m not permmited)

If i understand your question correctly, your function edit_temp_driver would be something like this:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement