refactor basis form class
This commit is contained in:
parent
8e7ae163a2
commit
ab45d164e7
|
@ -15,13 +15,13 @@ class DummyForm(ModelForm):
|
|||
model = Employee
|
||||
fields = []
|
||||
|
||||
class FdbForm(ModelForm):
|
||||
class EvaForm(ModelForm):
|
||||
'''this base class provides the required css class for all forms'''
|
||||
required_css_class = 'required'
|
||||
|
||||
TYPE_CHOICES = {'IN': 'Eintritt', 'CHANGE': 'Veränderung', 'OUT': 'Austritt'}
|
||||
|
||||
class PersonalForm(FdbForm):
|
||||
class PersonalForm(EvaForm):
|
||||
choice = ChoiceField(choices=TYPE_CHOICES.items(), widget=RadioSelect,
|
||||
label='Welcher Prozess soll angestoßen werden?')
|
||||
|
||||
|
@ -29,7 +29,7 @@ class PersonalForm(FdbForm):
|
|||
model = Employee
|
||||
fields = ['firstname', 'lastname', 'email', 'department', 'team', ]
|
||||
|
||||
class WorkingForm(FdbForm):
|
||||
class WorkingForm(EvaForm):
|
||||
class Meta:
|
||||
model = Employee
|
||||
fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german',
|
||||
|
@ -37,19 +37,19 @@ class WorkingForm(FdbForm):
|
|||
widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}),
|
||||
'firstdate_presence': DateInput(attrs={'type': 'date'}),}
|
||||
|
||||
class ITForm(FdbForm):
|
||||
class ITForm(EvaForm):
|
||||
class Meta:
|
||||
model = Employee
|
||||
fields = [
|
||||
'laptop', 'os', 'screen', 'mobile', 'landline', 'comment',
|
||||
'language', 'accounts', 'lists', ]
|
||||
|
||||
class OfficeForm(FdbForm):
|
||||
class OfficeForm(EvaForm):
|
||||
class Meta:
|
||||
model = Employee
|
||||
fields = ['transponder', 'post_office_box',]
|
||||
|
||||
class ChangeForm(FdbForm):
|
||||
class ChangeForm(EvaForm):
|
||||
class Meta:
|
||||
model = Employee
|
||||
fields = ['firstdate_employment', 'jobdescription_german', 'jobdescription_english',
|
||||
|
|
Loading…
Reference in New Issue