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 model = Employee
fields = [] fields = []
class FdbForm(ModelForm): class EvaForm(ModelForm):
'''this base class provides the required css class for all forms''' '''this base class provides the required css class for all forms'''
required_css_class = 'required' required_css_class = 'required'
TYPE_CHOICES = {'IN': 'Eintritt', 'CHANGE': 'Veränderung', 'OUT': 'Austritt'} TYPE_CHOICES = {'IN': 'Eintritt', 'CHANGE': 'Veränderung', 'OUT': 'Austritt'}
class PersonalForm(FdbForm): class PersonalForm(EvaForm):
choice = ChoiceField(choices=TYPE_CHOICES.items(), widget=RadioSelect, choice = ChoiceField(choices=TYPE_CHOICES.items(), widget=RadioSelect,
label='Welcher Prozess soll angestoßen werden?') label='Welcher Prozess soll angestoßen werden?')
@ -29,7 +29,7 @@ class PersonalForm(FdbForm):
model = Employee model = Employee
fields = ['firstname', 'lastname', 'email', 'department', 'team', ] fields = ['firstname', 'lastname', 'email', 'department', 'team', ]
class WorkingForm(FdbForm): class WorkingForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german', fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german',
@ -37,19 +37,19 @@ class WorkingForm(FdbForm):
widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}), widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}),
'firstdate_presence': DateInput(attrs={'type': 'date'}),} 'firstdate_presence': DateInput(attrs={'type': 'date'}),}
class ITForm(FdbForm): class ITForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = [ fields = [
'laptop', 'os', 'screen', 'mobile', 'landline', 'comment', 'laptop', 'os', 'screen', 'mobile', 'landline', 'comment',
'language', 'accounts', 'lists', ] 'language', 'accounts', 'lists', ]
class OfficeForm(FdbForm): class OfficeForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['transponder', 'post_office_box',] fields = ['transponder', 'post_office_box',]
class ChangeForm(FdbForm): class ChangeForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['firstdate_employment', 'jobdescription_german', 'jobdescription_english', fields = ['firstdate_employment', 'jobdescription_german', 'jobdescription_english',