class userCastem(AbstractUser): telephon = models.CharField('Телефон',max_length=20, unique=True) foto = models.ImageField("Фото", upload_to= "images/employee",blank=True, null=True) USERNAME_FIELD = 'telephon' objects = CustomUserManager() def __str__(self): return self.telephon class Employee(models.Model): userEmployee = models.OneToOneField("userCastem", on_delete=models.CASCADE) tip = models.CharField('Тип',max_length=100, blank=True, null=True) score = models.IntegerField("Счет",blank=True,null=True) class Meta: verbose_name = 'Сотрудник' verbose_name_plural = 'Сотрудники' class Customer (models.Model): userCustomer = models.OneToOneField("userCastem", on_delete=models.CASCADE) userscore = models.IntegerField("Счет",blank=True,null=True) class Meta: verbose_name = 'Клиент' verbose_name_plural = 'Клиенты'
Обсуждают сегодня