Skip to content
Advertisement

How to save some data in user model and some data save in extended user model from a html form

model.py

JavaScript

views.py

JavaScript

enter image description here

I want to save the user name, email, password in the user model and others field wants to save in the UserProfile model.

Then want to fetch data like- {{user.UserProfile.phone}}

Advertisement

Answer

I had the same issue I saved the data using the same method as you did.

JavaScript

And now I’m able to save the data.

For fetching the data you need to use this- {{user.userprofile.phone}}

For me the name of extended class is Extended_user and I used {{user.extended_user.mobile_no}}

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