Project

General

Profile

Download (1.07 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / statistics / forms.py @ 37ef36c7

1
# -*- coding: utf-8 -*-
2
from django import forms
3
from django.forms import Form
4

    
5
from ajax_select import make_ajax_field
6

    
7
from statistics import Statistic
8

    
9

    
10
class BaseForm(Form):
11
    display_or_export = forms.BooleanField(label=u'Exporter dans un fichier', required=False, localize=True)
12

    
13
class OneDateForm(BaseForm):
14
    start_date = forms.DateField(label=u'Date', required=False, localize=True)
15

    
16
class TwoDatesForm(BaseForm):
17
    start_date = forms.DateField(label=u'Date de début', required=False, localize=True)
18
    end_date = forms.DateField(label=u'Date de fin', required=False, localize=True)
19

    
20
class AnnualActivityForm(BaseForm):
21
    start_date = forms.DateField(label=u"Date de l'année souhaitée", required=False, localize=True)
22
    participants = make_ajax_field(Statistic, 'participants', 'worker-or-group', True)
23

    
24
class PatientsTwoDatesForm(TwoDatesForm):
25
    patients = make_ajax_field(Statistic, 'patients', 'patientrecord', True)
26

    
27
class ParticipantsPatientsTwoDatesForm(PatientsTwoDatesForm):
28
    participants = make_ajax_field(Statistic, 'participants', 'worker-or-group', True)
(3-3/8)