AUTH_USER_MODEL = "auth.User"
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
SUPERADMIN = 0
ADMIN = 1
SALES = 2
ROLE_CHOICES = (
(SUPERADMIN, 'Super Admin'),
(ADMIN, 'Admin'),
(SALES, 'Sales'),
)
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, blank=True, null=True)
Will this not work on an existing django project ?
It looks like I have to DROP DATABASE and delete all the migrations files in \migrations folder and then only it seems to work.
Wondering how I can incorporate this in an existing Django Project.