[Answered ]-Django – Creating a new user model extending an already extended user model

1👍

I’ll suggest using OneToOneField like this:

class Teacher(models.Model):
    user = models.OneToOneField(NewUser, related_name='teacher')
    # Other fields that related to Teacher

class Student(models.Model):
    user = models.OneToOneField(NewUser, related_name='student')
    # Other fields that related to Student

So, NewUser model will be responsible only for the login, signup, and permissions.

Leave a comment