Project

General

Profile

Download (2.4 KB) Statistics
| Branch: | Revision:

git_sitools_idoc / webstatDev / idoc_Maison.OLD / webstat / forms.py @ 9791e4f3

1 9791e4f3 Marc Nicolas
#-*-coding:utf-8-*-
2
from django import forms
3
from models import webstatModel
4
from datetimewidget.widgets import DateTimeWidget,DateWidget
5
6
7
class webstatForm(forms.ModelForm):
8
9
    class Meta:
10
11
        model = webstatModel
12
        fields = ['application', 'all_date', 'period_date', 'start_date', 'end_date',
13
                  'is_access_access_by_ip', 'is_access_access_by_months', 'is_access_access_by_country',
14
                  #'is_access_vo_by_ip', 'is_access_vo_by_months', 'is_access_vo_by_country',
15
                  'is_down_stat_by_user', 'is_down_stat_by_ip', 'is_down_stat_by_country', 'is_down_stat_by_months',
16
                  'is_down_stat_by_project', 'is_just_down_stat']
17
                  #, 'nb_element'
18
        labels = {
19
            'application': 'Webapp SITools2 ',
20
            'start_date': 'Du ',
21
            'end_date': ' Au ',
22
            'all_date': 'Tous',
23
            'period_date': 'Sur une période',
24
            'is_access_access_by_ip': 'Access by Ip',
25
            'is_access_access_by_months': 'Access by Month',
26
            'is_access_access_by_country': 'Access by Country',
27
            #'is_access_vo_by_ip': 'Vo Access by Ip',
28
            #'is_access_vo_by_months': 'Vo Access by Month',
29
            #'is_access_vo_by_country': 'Vo Access by Country',
30
            'is_down_stat_by_user': 'Down by User',
31
            'is_down_stat_by_ip': 'Down by Ip',
32
            'is_down_stat_by_country': 'Down by Country',
33
            'is_down_stat_by_months': 'Down by Month',
34
            'is_down_stat_by_project': 'Down by Project',
35
            'is_just_down_stat': 'Just Down',
36
        }
37
38
        dateTimeOptions = {
39
                'format': 'dd/mm/yyyy',
40
                #'startView': '',
41
                'minView': 2,
42
                'maxView': 2,
43
                'autoclose': True,
44
                'clearBtn': 'true',
45
        }
46
47
        widgets = {
48
            'all_date': forms.CheckboxInput(attrs={"onClick": 'checkIfAll()'}),
49
            'period_date': forms.CheckboxInput(attrs={"onClick": 'checkIfPeriod()'}),
50
#            'start_date': DateWidget(usel10n=True, bootstrap_version=3),
51
#            'end_date': DateWidget(usel10n=True, bootstrap_version=3),
52
            #'is_down_stat': forms.CheckboxInput(attrs={"onClick": 'checkIfDownStat()'}),
53
            #'is_access_stat': forms.CheckboxInput(attrs={"onClick": 'checkIfAccessStat()'}),
54
            'application': forms.Select(attrs={"onClick": 'onChangeApp()'}),
55
        }