From 0380c48cf99cd05e97c40305622595eb2b5e6615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Grou=C3=A8s?= <valentin.groues@uni.lu> Date: Tue, 21 Mar 2017 14:34:00 +0100 Subject: [PATCH] #66 - show appointments types list as checkboxes --- smash/web/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smash/web/forms.py b/smash/web/forms.py index b86fed54..920d6922 100644 --- a/smash/web/forms.py +++ b/smash/web/forms.py @@ -131,7 +131,7 @@ class AppointmentEditForm(ModelForm): datetime_when = forms.DateTimeField(label='Appointment on (YYYY-MM-DD HH:MM)', widget=forms.DateTimeInput(DATETIMEPICKER_DATE_ATTRS) ) - appointment_types = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, + appointment_types = forms.ModelMultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, queryset=AppointmentType.objects.all()) def __init__(self, *args, **kwargs): @@ -160,7 +160,7 @@ class AppointmentAddForm(ModelForm): datetime_when = forms.DateTimeField(label='Appointment on (YYYY-MM-DD HH:MM)', widget=forms.DateTimeInput(DATETIMEPICKER_DATE_ATTRS) ) - appointment_types = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, + appointment_types = forms.ModelMultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, queryset=AppointmentType.objects.all()) def __init__(self, *args, **kwargs): @@ -190,7 +190,7 @@ class VisitDetailForm(ModelForm): ) post_mail_sent = forms.RadioSelect() - appointment_types = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, + appointment_types = forms.ModelMultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, queryset=AppointmentType.objects.all()) class Meta: @@ -206,7 +206,7 @@ class VisitAddForm(ModelForm): datetime_end = forms.DateField(label="Visit ends on", widget=forms.TextInput(attrs=DATEPICKER_DATE_ATTRS) ) - appointment_types = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, + appointment_types = forms.ModelMultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, queryset=AppointmentType.objects.all()) class Meta: -- GitLab