Y
Y
Yura Khlyan2016-05-19 13:15:36
Django
Yura Khlyan, 2016-05-19 13:15:36

How to change the USER model?

Good day.
I need to modify the default user model in Django-Oscar. As far as I read, everything is not so simple there, you can’t just inherit from your native model and go ahead. Tell me how to add new fields to the model?
I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad, 2016-05-19
@d1skort

Inherit from AbstractBaseUser
https://docs.djangoproject.com/es/1.9/topics/auth/...

K
Keofaste, 2016-05-19
@Keofaste

from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.OneToOneField(User)
You can access the profile like this: my_user.userprofile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question