forms.py 2.28 KB
# Django imports
from django import forms

# Project imports
from user_mgmt.models import PyrosUser #, UserLevel
#from common.models import Config
from majordome.models import Majordome


# 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 :'),
#         }

class MajordomeForm(forms.ModelForm):
    class Meta:
        model = Majordome
        fields = (
            "soft_mode",
        )
        labels = {
            "soft_mode": ("Software mode :")
        }

''' (EP) moved to user_manager/forms
class UserForm(forms.ModelForm):
    class Meta:
        model = PyrosUser
        fields = ('username',
                  'first_name',
                  'last_name',
                  'email',
                  'country',
                  'institute',
                  #'user_level',
                  'desc',
                  'tel',
                  'address',
                  'laboratory',
                  "referee_themes"
                  )
        widgets = {
            # (AKo) We use a checkboxselectmultiple for user_level because it's a m2m relation
            "user_level": forms.CheckboxSelectMultiple(),
            "referee_themes": forms.CheckboxSelectMultiple()
        } 
'''