I'm creating a SAAS as a project, and can't seem to wrap my dinosaur brain around this auth system. I started to roll my own system before I realized you could add on to the normal auth system. Is this completely wrong? Should I somehow extend the User model but still include all of my own attributes (username, password, etc)?
from django.db import models
from django.contrib.auth.models import User
from annoying.fields import AutoOneToOneField
from myproject.core.modelfields import LowerAlphanumericField
from myproject.apps.account.models import Account
class Administrator(models.Model):
"""
Administrator for an Account (application holds multiple accounts as it is a SAAS).
"""
account = models.ForeignKey(Account)
user = AutoOneToOneField(User, primary_key=True)
name = models.CharField(max_length=255)
email = models.EmailField()
username = LowerAlphanumericField(max_length=30)
password = models.CharField(max_length=255)
If I visit http://127.0.0.1:8080/admin/auth/user/3/ I get an error, but the primary key for the third administrator object I created is 3 (which one would assume is the primary key for the related User object. Am I missing something. Also, do I need to create a password field, and all that junk here, or rather should I?