Revision 9ca08421
Added by Jérôme Schneider about 11 years ago
calebasse/agenda/forms.py | ||
---|---|---|
91 | 91 |
return appointment |
92 | 92 |
|
93 | 93 |
class UpdateAppointmentForm(NewAppointmentForm): |
94 |
|
|
94 | 95 |
class Meta(NewAppointmentForm.Meta): |
95 | 96 |
fields = ( |
96 | 97 |
'start_datetime', |
... | ... | |
105 | 106 |
|
106 | 107 |
|
107 | 108 |
class UpdatePeriodicAppointmentForm(NewAppointmentForm): |
109 |
recurrence_periodicity = forms.ChoiceField(label=u"Périodicité", |
|
110 |
choices=Event.PERIODICITIES, required=True) |
|
108 | 111 |
|
109 | 112 |
def clean(self): |
110 | 113 |
cleaned_data = super(UpdatePeriodicAppointmentForm, self).clean() |
... | ... | |
197 | 200 |
u"Ce champ est obligatoire pour les événements de type « Autre »."]) |
198 | 201 |
return cleaned_data |
199 | 202 |
|
203 |
class UpdatePeriodicEventForm(NewEventForm): |
|
204 |
recurrence_periodicity = forms.ChoiceField(label=u"Périodicité", |
|
205 |
choices=Event.PERIODICITIES, required=True) |
|
200 | 206 |
|
201 | 207 |
class UpdateEventForm(NewEventForm): |
202 | 208 |
class Meta(NewEventForm.Meta): |
calebasse/agenda/views.py | ||
---|---|---|
24 | 24 |
from calebasse import cbv |
25 | 25 |
|
26 | 26 |
from calebasse.agenda.forms import (NewAppointmentForm, NewEventForm, UpdatePeriodicAppointmentForm, |
27 |
DisablePatientAppointmentForm, UpdateAppointmentForm, |
|
27 |
DisablePatientAppointmentForm, UpdateAppointmentForm, UpdatePeriodicEventForm,
|
|
28 | 28 |
UpdateEventForm, PeriodicEventsSearchForm) |
29 | 29 |
|
30 | 30 |
logger = logging.getLogger(__name__) |
... | ... | |
267 | 267 |
|
268 | 268 |
|
269 | 269 |
class UpdatePeriodicEventView(BaseEventView): |
270 |
form_class = NewEventForm
|
|
270 |
form_class = UpdatePeriodicEventForm
|
|
271 | 271 |
template_name = 'agenda/new-event.html' |
272 | 272 |
|
273 | 273 |
|
Also available in: Unified diff
agenda: required periodicity when editing a recurrence