и SpecialistUser?
class PhoneModel(models.Model):
phone = models.CharField(validators=[phone_regex], max_length=13, blank=True)
is_verified = models.BooleanField(blank=False, default=False)
counter = models.IntegerField(default=0, blank=False)
def __str__(self):
return f'{self.phone}'
class UserRoles(models.Model):
is_client = models.BooleanField(default=False)
is_specialist = models.BooleanField(default=False)
class ClientUser(AbstractBaseUser):
role = models.OneToOneField(UserRoles, on_delete=models.CASCADE, primary_key=True)
phone = models.OneToOneField(PhoneModel, on_delete=models.CASCADE)
class SpecialistUser(AbstractBaseUser):
role = models.OneToOneField(UserRoles, on_delete=models.CASCADE, primary_key=True)
phone = models.OneToOneField(PhoneModel, on_delete=models.CASCADE)
Зачем две модели юзера? Оо
Userroles перепиши...
Обсуждают сегодня