This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
facturio/accounts/models.py

19 lines
551 B
Python
Raw Normal View History

2023-12-18 22:09:18 +01:00
from django.contrib.auth.models import AbstractUser
2023-12-19 13:49:34 +01:00
from django.db import models
from django.utils.translation import gettext_lazy as _
2023-12-18 21:00:37 +01:00
2024-02-03 21:54:05 +01:00
from subjects.models import Subject
2023-12-18 22:09:18 +01:00
class User(AbstractUser):
2024-02-03 22:07:20 +01:00
REQUIRED_FIELDS = ['email', 'first_name', 'last_name']
2023-12-19 13:49:34 +01:00
2024-02-03 22:07:20 +01:00
first_name = models.CharField(_('first name'), max_length=150)
last_name = models.CharField(_('last name'), max_length=150)
email = models.EmailField(_('email address'))
2023-12-19 13:49:34 +01:00
2024-02-03 21:54:05 +01:00
subjects = models.ManyToManyField(Subject, blank=True)
2023-12-19 13:49:34 +01:00
class Meta(AbstractUser.Meta):
2024-02-03 21:54:05 +01:00
...