mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
24 lines
662 B
Python
24 lines
662 B
Python
from django.db import models
|
|
|
|
from apps.core.models import BaseModel
|
|
|
|
|
|
class UserRole(models.Choices):
|
|
STUDENT = "student"
|
|
METODIST = "metodist"
|
|
|
|
|
|
class User(BaseModel):
|
|
email = models.EmailField(unique=True, verbose_name="Почта")
|
|
username = models.SlugField(unique=True, verbose_name="Юзернейм")
|
|
password = models.TextField(verbose_name="Пароль")
|
|
|
|
status = models.CharField(max_length=10, choices=UserRole.choices, default=UserRole.STUDENT)
|
|
|
|
def __str__(self):
|
|
return self.username
|
|
|
|
class Meta:
|
|
verbose_name = "пользователь"
|
|
verbose_name_plural = "пользователи"
|