From ab45d164e73f77c4a68b30eaa11c59a364f6f39b Mon Sep 17 00:00:00 2001 From: alfi Date: Thu, 4 Feb 2021 10:41:52 +0100 Subject: [PATCH] refactor basis form class --- evapp/forms.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/evapp/forms.py b/evapp/forms.py index a6b7fe9..60f2cf5 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -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',