Advertisement
Mochinov

Untitled

Nov 13th, 2020
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. class Doctor(models.Model):
  2. TYPE_CALL = [
  3. ('Общие практики (Терапевт/Педеатор)','Общие практики (Терапевт/Педеатор)'),
  4. ('COVID', 'COVID'),
  5. ('Хроники', 'Хроники'),
  6. ]
  7. CHOICES_OPTION = (
  8. ('Есть', 'Есть'),
  9. ('Нет', 'Нет'),
  10. )
  11. user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name='Пользователь',default=None)
  12. fio = models.CharField('Ф.И.О', max_length=255, blank=False, db_index=True, null=True)
  13. polyclinic = models.ForeignKey('Polyclinic', on_delete=models.SET_NULL, blank=True, null=True)
  14. zone = models.ManyToManyField('Zone', blank=False)
  15. position = models.CharField('Должность', max_length = 150, blank=True)
  16. specialty = models.CharField('Специальность', max_length = 150, blank=True)
  17. town = models.ForeignKey(Town, verbose_name="Город",null=True, blank=False, on_delete=models.SET_NULL)
  18. phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$')
  19. phone = models.CharField('Контактный номер телефона', validators=[phone_regex], max_length=17, blank=True,db_index=True)
  20. type_call = models.CharField('Тип врача', max_length=50, choices=TYPE_CALL, null=True, blank=True)
  21. objects = DoctorManager()
  22. drivers_license = models.CharField('Водительское удостоверение', choices=CHOICES_OPTION, max_length=20, null=True, blank=True)
  23. password = models.CharField('Пароль', max_length=8, blank=False, db_index=True, null=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement