services papkasi o'chirildi

This commit is contained in:
A'zamov Samandar
2025-04-19 15:18:13 +05:00
parent 291f31b09b
commit eff4606079
124 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
from django.contrib.auth import models as auth_models
from django.db import models
from ..choices import RoleChoice
from ..managers import UserManager
class User(auth_models.AbstractUser):
phone = models.CharField(max_length=255, unique=True)
username = models.CharField(max_length=255, null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
validated_at = models.DateTimeField(null=True, blank=True)
role = models.CharField(
max_length=255,
choices=RoleChoice,
default=RoleChoice.USER,
)
USERNAME_FIELD = "phone"
objects = UserManager()
def __str__(self):
return self.phone