Project

General

Profile

« Previous | Next » 

Revision 3e9b47e9

Added by Benjamin Dauvergne over 12 years ago

agenda: add editing of periodic events

View differences:

calebasse/agenda/forms.py
12 12
from ajax_select import make_ajax_field
13 13
from models import Event, EventWithAct, EventType
14 14

  
15
class NewAppointmentForm(forms.ModelForm):
15
class BaseForm(forms.ModelForm):
16 16
    date = forms.DateField(label=u'Date', localize=True)
17 17
    time = forms.TimeField(label=u'Heure de début')
18 18
    duration = forms.CharField(label=u'Durée',
19 19
            help_text=u'en minutes; vous pouvez utiliser la roulette de votre souris.')
20

  
21 20
    participants = make_ajax_field(EventWithAct, 'participants', 'worker-or-group', True)
21

  
22

  
23
class NewAppointmentForm(BaseForm):
22 24
    patient = make_ajax_field(EventWithAct, 'patient', 'patientrecord', False)
23 25

  
24 26
    class Meta:
......
99 101
        )
100 102

  
101 103

  
102
class NewEventForm(forms.ModelForm):
103

  
104
class NewEventForm(BaseForm):
104 105
    title = forms.CharField(label=u"Complément de l'intitulé", max_length=32, required=False)
105
    date = forms.DateField(label=u'Date', localize=True)
106
    time = forms.TimeField(label=u'Heure de début')
107
    duration = forms.CharField(label=u'Durée',
108
            help_text=u'en minutes; vous pouvez utiliser la roulette de votre souris.')
109

  
110
    participants = make_ajax_field(Event, 'participants', 'worker-or-group', True)
111 106

  
112 107
    class Meta:
113 108
        model = Event

Also available in: Unified diff