mirror of
https://github.com/jazzband/django-authority.git
synced 2026-03-16 22:20:28 +00:00
20 lines
738 B
Python
20 lines
738 B
Python
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
|
|
from django.contrib.auth.models import UserManager
|
|
from django.db import models
|
|
from django.utils import timezone
|
|
|
|
|
|
class User(AbstractBaseUser, PermissionsMixin):
|
|
USERNAME_FIELD = "email"
|
|
REQUIRED_FIELDS = ["first_name", "last_name"]
|
|
|
|
username = models.CharField(max_length=100)
|
|
first_name = models.CharField(max_length=50)
|
|
last_name = models.CharField(max_length=50)
|
|
email = models.EmailField(unique=True)
|
|
greeting_message = models.TextField()
|
|
is_staff = models.BooleanField(default=False)
|
|
is_active = models.BooleanField(default=True)
|
|
date_joined = models.DateTimeField(default=timezone.now)
|
|
|
|
objects = UserManager()
|