Revision cb424fd8
Added by Mikaël Ates about 12 years ago
| calebasse/statistics/forms.py | ||
|---|---|---|
|
from statistics import Statistic
|
||
|
|
||
|
|
||
|
class StatForm(Form):
|
||
|
class BaseForm(Form):
|
||
|
display_or_export = forms.BooleanField(label=u'Exporter dans un fichier', required=False, localize=True)
|
||
|
start_date = forms.DateField(label=u'Date de début', required=False, localize=True)
|
||
|
end_date = forms.DateField(label=u'Date de fin', required=False, localize=True)
|
||
|
patients = make_ajax_field(Statistic, 'patients', 'patientrecord', True)
|
||
|
participants = make_ajax_field(Statistic, 'participants', 'worker-or-group', True)
|
||
|
|
||
|
class ActivePatientsForm(Form):
|
||
|
display_or_export = forms.BooleanField(label=u'Exporter dans un fichier', required=False, localize=True)
|
||
|
class OneDateForm(BaseForm):
|
||
|
start_date = forms.DateField(label=u'Date', required=False, localize=True)
|
||
|
|
||
|
class TwoDatesForm(BaseForm):
|
||
|
start_date = forms.DateField(label=u'Date de début', required=False, localize=True)
|
||
|
end_date = forms.DateField(label=u'Date de fin', required=False, localize=True)
|
||
|
|
||
|
class AnnualActivityForm(Form):
|
||
|
display_or_export = forms.BooleanField(label=u'Exporter dans un fichier', required=False, localize=True)
|
||
|
class AnnualActivityForm(BaseForm):
|
||
|
start_date = forms.DateField(label=u"Date de l'année souhaitée", required=False, localize=True)
|
||
|
participants = make_ajax_field(Statistic, 'participants', 'worker-or-group', True)
|
||
|
|
||
|
class PatientsDetailsForm(Form):
|
||
|
display_or_export = forms.BooleanField(label=u'Exporter dans un fichier', required=False, localize=True)
|
||
|
start_date = forms.DateField(label=u'Date de début', required=False, localize=True)
|
||
|
end_date = forms.DateField(label=u'Date de fin', required=False, localize=True)
|
||
|
class PatientsTwoDatesForm(TwoDatesForm):
|
||
|
patients = make_ajax_field(Statistic, 'patients', 'patientrecord', True)
|
||
|
|
||
|
class ParticipantsPatientsTwoDatesForm(PatientsTwoDatesForm):
|
||
|
participants = make_ajax_field(Statistic, 'participants', 'worker-or-group', True)
|
||
Also available in: Unified diff
statistics: refactor forms.