chol
/
eva
forked from tohe/eva
1
0
Fork 0

refactor basis form class

This commit is contained in:
Alexander Finger 2021-02-04 10:41:52 +01:00
parent 8e7ae163a2
commit ab45d164e7
1 changed files with 6 additions and 6 deletions

View File

@ -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',