Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ Вьюшка для обновления настройки таблицы тамбова """
- class PacientSettingsTableUpdate(UpdateView):
- """ Обновление настроек таблицы пациентов пользователя"""
- form_class = SpisSettingsForm
- success_url = reverse_lazy('users:pacient_list')
- template_name = 'users/update_settings.html'
- def get_object(self, queryset=None):
- obj, created = SpisSettings.objects.get_or_create(doctor=self.request.user)
- return obj
- ------------------------------------------------------------------------------------------------------------
- """ Форма настройки пациента """
- class SpisSettingsForm(forms.ModelForm):
- """ Форма настройки пациента """
- class Meta:
- model = SpisSettings
- exclude = ['doctor']
- ------------------------------------------------------------------------------------------------------------
- """ Таблица для редактирования настройки """
- class SpisSettings(models.Model):
- doctor = models.OneToOneField(CustomUser, on_delete = models.CASCADE, default=None, verbose_name='Врач')
- fam = models.BooleanField(verbose_name = "Фамилия", blank=True, null=True, default=True)
- im = models.BooleanField(verbose_name = "Имя", blank=True, null=True, default=True)
- otc = models.BooleanField(verbose_name = "Отчество", blank=True, null=True, default=True)
- adr = models.BooleanField(verbose_name = "Улица", blank=True, null=True, default=True)
- dom = models.BooleanField(verbose_name = "Дом", blank=True, null=True, default=True)
- kor = models.BooleanField(verbose_name = "Корпус", blank=True, null=True, default=True)
- kw = models.BooleanField(verbose_name = "Квартира", blank=True, null=True, default=True)
- pol = models.BooleanField(verbose_name="Пол", blank=True, null=True, default=True)
- sot_tel = models.BooleanField(verbose_name="Сотовый телефон", blank=True, null=True, default=True)
- dat = models.BooleanField(verbose_name="Дата рождения", blank=True, null=True, default=True)
- ss = models.BooleanField(verbose_name="СНИЛС", blank=True, null=True, default=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement