Home > other >  Python django rookie help model updating data
Python django rookie help model updating data

Time:09-21

Excuse me, have to update data of a model to another model the way is in the
I define a user model, for example, the inside of the field are:
Account, password, email address, phone number, gender, work address, the registration time, etc.
There is also a user_profile model, the inside of the field are:
Mobile phone number, gender, work address

When user_profile data update, is there any way to a phone number, gender, work address an update to the user?

Hope to have bosses to solve!!!!

CodePudding user response:

https://www.cnblogs.com/lowmanisbusy/p/9797127.html

CodePudding user response:

In the view. The py update a models in the following models filling line not line?
Models. Pro. Objects. The create (pro_id=num, user_id=user_id, user_name=user_name, mail=email, theme=subject, the content=message)
Models. Ans. Objects. The create (ans_id=num, ans_content=text, to_pro_id=pro_id, user_name=user_name)
  • Related