Extending User model using One-To-One Relationship - Django

Extending User model using One-To-One Relationship - Django

StudyGyaan

4 года назад

15,981 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

BKFirst
BKFirst - 20.04.2023 22:30

Can I do this If I am using AbstractUser?

Ответить
Din Islam DR
Din Islam DR - 31.08.2022 11:15

So wonderful bro

Ответить
Ankush Pandey
Ankush Pandey - 05.08.2022 16:12

this really helped thank a lot

Ответить
Puterich
Puterich - 15.07.2022 00:52

why have two methods? Couldn't the save method be called before the create method? and why save the user and not the profile?

Ответить
Nishant soni
Nishant soni - 11.06.2021 12:42

USE THIS IN YOUR PROFILE MODULE:
def __str__(self):
return f'{self.user.username} Profile'

this code save profile with the name of user profile example : object profile(1) saves with admin profile

Ответить
Andre Barreto
Andre Barreto - 27.01.2021 19:16

really thanks sir! i learing a lot!

Ответить
Izzati
Izzati - 18.01.2021 18:32

hi there, i seem to get the error: OperationalError at /admin/login/
no such table: userprofile_profile after trying to login using superuser. what could have been wrong?

Ответить
Anish Kumar
Anish Kumar - 22.10.2020 18:05

How i can contact you its important

Ответить
gabriel turrillas
gabriel turrillas - 29.09.2020 06:21

If i have a custom user model i have to create a field for the user model to hold the relationship? i have han error: instance.profile.save()
AttributeError: 'UserAccount' object has no attribute 'profile'
ty for your time

Ответить
gabriel turrillas
gabriel turrillas - 22.09.2020 06:19

great!

Ответить
Awanti Chavan
Awanti Chavan - 20.09.2020 20:00

Hello sir.. watched Ur playlist and got the contents I was searching for.. Really you did a great job making these videos which are very much useful...but I had a doubt on the admin page we can see the "Django administration " I wanted to ask is can we change the name Django administration to some other name and if we can then can you please tell how it is possible..plzz do reply..

Ответить
Semih
Semih - 27.06.2020 21:21

after created user, I cannot see profile right away.

Ответить
Jesús J. Navarro
Jesús J. Navarro - 24.04.2020 18:00

Hello friend, your videos have been very helpful to me. I have a problem with a code when creating a model, can you help me?

Ответить