18 lines
551 B
Python
18 lines
551 B
Python
from django.contrib.auth.models import AbstractUser
|
|
from django.db import models
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from subjects.models import Subject
|
|
|
|
|
|
class User(AbstractUser):
|
|
REQUIRED_FIELDS = ['email', 'first_name', 'last_name']
|
|
|
|
first_name = models.CharField(_('first name'), max_length=150)
|
|
last_name = models.CharField(_('last name'), max_length=150)
|
|
email = models.EmailField(_('email address'))
|
|
|
|
subjects = models.ManyToManyField(Subject, blank=True)
|
|
|
|
class Meta(AbstractUser.Meta):
|
|
...
|