I am starting a new project and I created my user model extending the AbstractBaseUser, like below:
class NewUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField( unique=True)
user_name = models.CharField(max_length=150, unique=True)
...
I am wondering whether it is possible and makes sense to create my user (e.g. Teacher)
by extending NewUser, and adding all of the Teacher profile info.
That would be something like:
class Teacher(NewUser):
role = models.CharField(max_length=150)
title = models.CharField(max_length=150)
date_of_birth = models.CharField(max_length=150)
...
Would this be good practice and would it allow me to use the built-in authentication methods with DRS?
And would this give more flexibility if then I want to enable other users (e.g. Students) to also register an account and log-in?
Or would it make more sense to just use NewUser directly?
Would Really appreciate some advice/ insight!