Revision 2ae5dd3d
Added by Benjamin Dauvergne over 12 years ago
calebasse/agenda/forms.py | ||
---|---|---|
86 | 86 |
|
87 | 87 |
|
88 | 88 |
class UpdateAppointmentForm(NewAppointmentForm): |
89 |
pass |
|
89 |
class Meta(NewAppointmentForm.Meta): |
|
90 |
fields = ( |
|
91 |
'start_datetime', |
|
92 |
'date', |
|
93 |
'time', |
|
94 |
'duration', |
|
95 |
'patient', |
|
96 |
'participants', |
|
97 |
'room', |
|
98 |
'act_type', |
|
99 |
) |
|
90 | 100 |
|
91 | 101 |
|
92 | 102 |
class NewEventForm(forms.ModelForm): |
... | ... | |
157 | 167 |
self._errors['title'] = self.error_class([ |
158 | 168 |
u"Ce champ est obligatoire pour les événements de type « Autre »."]) |
159 | 169 |
return cleaned_data |
170 |
|
|
171 |
|
|
172 |
class UpdateEventForm(NewEventForm): |
|
173 |
class Meta(NewEventForm.Meta): |
|
174 |
fields = ( |
|
175 |
'start_datetime', |
|
176 |
'title', |
|
177 |
'date', |
|
178 |
'time', |
|
179 |
'duration', |
|
180 |
'room', |
|
181 |
'participants', |
|
182 |
'event_type', |
|
183 |
'services', |
|
184 |
) |
calebasse/agenda/views.py | ||
---|---|---|
19 | 19 |
from calebasse.actes.validation import (automated_validation, unlock_all_acts_of_the_day) |
20 | 20 |
from calebasse import cbv |
21 | 21 |
|
22 |
from forms import (NewAppointmentForm, NewEventForm, UpdateAppointmentForm) |
|
22 |
from forms import (NewAppointmentForm, NewEventForm, UpdateAppointmentForm, UpdateEventForm)
|
|
23 | 23 |
|
24 | 24 |
def redirect_today(request, service): |
25 | 25 |
'''If not date is given we redirect on the agenda for today''' |
... | ... | |
185 | 185 |
|
186 | 186 |
class UpdateEventView(TodayOccurrenceMixin, UpdateView): |
187 | 187 |
model = Event |
188 |
form_class = NewEventForm
|
|
188 |
form_class = UpdateEventForm
|
|
189 | 189 |
template_name = 'agenda/update-event.html' |
190 | 190 |
success_url = '..' |
191 | 191 |
|
Also available in: Unified diff
agenda: hide periodicity fields when editing event and appointments