Blame view

src/core/pyros_django/dashboard/forms.py 2.28 KB
eefbbbd2   Etienne Pallier   Model splitting g...
1
# Django imports
da13e230   Alexis Koralewski   update UI of webs...
2
from django import forms
eefbbbd2   Etienne Pallier   Model splitting g...
3
4

# Project imports
b95a693f   Alexis Koralewski   restructuration d...
5
from user_mgmt.models import PyrosUser #, UserLevel
93039f18   Alexis Koralewski   Fix issues due to...
6
#from common.models import Config
b95a693f   Alexis Koralewski   restructuration d...
7
from majordome.models import Majordome
eefbbbd2   Etienne Pallier   Model splitting g...
8

da13e230   Alexis Koralewski   update UI of webs...
9

93039f18   Alexis Koralewski   Fix issues due to...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# class ConfigForm(forms.ModelForm):
#     class Meta:
#         model = Config
#         fields = ('latitude',
#                   'local_time_zone',
#                   'longitude',
#                   'altitude',
#                   'horizon_line',
#                   'row_data_save_frequency',
#                   'request_frequency',
#                   'analysed_data_save',
#                   'telescope_ip_address',
#                   'camera_ip_address',
#                   'plc_ip_address',)
#         labels = {
#             'latitude': ('Latitude :'),
#             'local_time_zone': ('Local Time Zone :'),
#             'longitude': ('Longitude :'),
#             'altitude': ('Altitude :'),
#             'horizon_line': ('Horizon Line :'),
#             'row_data_save_frequency': ('Row Data Save Frequency :'),
#             'request_frequency': ('Request Frequency :'),
#             'analysed_data_save': ('Analysed Data Save :'),
#             'telescope_ip_address': ('Ip Address :'),
#             'camera_ip_address': ('Ip Address :'),
#             'plc_ip_address': ('Ip Address :'),
#         }
da13e230   Alexis Koralewski   update UI of webs...
37

c1a58d54   Alexis Koralewski   Adding views to v...
38
39
40
41
42
43
44
45
46
class MajordomeForm(forms.ModelForm):
    class Meta:
        model = Majordome
        fields = (
            "soft_mode",
        )
        labels = {
            "soft_mode": ("Software mode :")
        }
eefbbbd2   Etienne Pallier   Model splitting g...
47

43d8ca44   Etienne Pallier   moved dashboard.U...
48
''' (EP) moved to user_manager/forms
da13e230   Alexis Koralewski   update UI of webs...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class UserForm(forms.ModelForm):
    class Meta:
        model = PyrosUser
        fields = ('username',
                  'first_name',
                  'last_name',
                  'email',
                  'country',
                  'institute',
                  #'user_level',
                  'desc',
                  'tel',
                  'address',
                  'laboratory',
077d5a23   Alexis Koralewski   adding science th...
63
                  "referee_themes"
da13e230   Alexis Koralewski   update UI of webs...
64
65
66
                  )
        widgets = {
            # (AKo) We use a checkboxselectmultiple for user_level because it's a m2m relation
077d5a23   Alexis Koralewski   adding science th...
67
68
            "user_level": forms.CheckboxSelectMultiple(),
            "referee_themes": forms.CheckboxSelectMultiple()
43d8ca44   Etienne Pallier   moved dashboard.U...
69
70
        } 
'''