コード例 #1
0
ファイル: forms.py プロジェクト: davehenton/skolagatt
 def __init__(self, *args, **kwargs):
     super(SurveyForm, self).__init__(*args, **kwargs)
     MONTHS = {
         1: _('jan'), 2: _('feb'), 3: _('mar'), 4: _('apr'),
         5: _('maí'), 6: _('jún'), 7: _('júl'), 8: _('ágú'),
         9: _('sep'), 10: _('okt'), 11: _('nóv'), 12: _('des')
     }
     self.fields['active_from'].widget = SelectDateWidget(
         empty_label=("Ár", "Mánuður", "Dagur"),
         years=range(2016, timezone.now().year + 10),
         months=MONTHS,
         attrs={
             'class': 'required form-control',
             'style': 'width: 26%; display: inline-block;'
         })
     self.fields['active_to'].widget = SelectDateWidget(
         empty_label=("Ár", "Mánuður", "Dagur"),
         years=range(2016, timezone.now().year + 10),
         months=MONTHS,
         attrs={
             'class': 'required form-control',
             'style': 'width: 26%; display: inline-block;'
         })
     fields = [
         'identifier', 'title', 'survey_type', 'student_year', 'description'
     ]
     add_field_classes(self, fields)
コード例 #2
0
 def __init__(self, *args, **kwargs):
     super(SchoolForm, self).__init__(*args, **kwargs)
     fields_to_update = [
         'name', 'ssn', 'school_nr', 'address', 'post_code', 'municipality',
         'part'
     ]
     add_field_classes(self, fields_to_update)
     add_field_classes(self, ['managers', 'teachers', 'students'],
                       cssdef={
                           'class':
                           'form-control input-lg col-md-6 col-xs-12',
                       })
     self.fields['managers'].widget.attrs.update({'size': 4})
     self.fields['teachers'].widget.attrs.update({'size': 6})
     self.fields['students'].widget.attrs.update({'size': 12})
コード例 #3
0
 def __init__(self, *args, **kwargs):
     super(StudentForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)
コード例 #4
0
 def __init__(self, *args, **kwargs):
     super(TeacherForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)
コード例 #5
0
 def __init__(self, *args, **kwargs):
     super(SuperUserForm, self).__init__(*args, **kwargs)
     add_field_classes(self, ['username'])
コード例 #6
0
ファイル: forms.py プロジェクト: davehenton/skolagatt
 def __init__(self, *args, **kwargs):
     super(SurveyResourceForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)
コード例 #7
0
ファイル: forms.py プロジェクト: davehenton/skolagatt
 def __init__(self, *args, **kwargs):
     super(SurveyTransformationForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)
コード例 #8
0
ファイル: forms.py プロジェクト: davehenton/skolagatt
 def __init__(self, *args, **kwargs):
     super(SurveyInputGroupForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)
コード例 #9
0
ファイル: forms.py プロジェクト: davehenton/skolagatt
 def __init__(self, *args, **kwargs):
     super(SurveyGradingTemplateForm, self).__init__(*args, **kwargs)
     add_field_classes(self, self.fields)