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

mark required fields with red stars

This commit is contained in:
Benni Bärmann 2021-01-13 14:17:21 +01:00
parent b555af56bb
commit 4b1875eaeb
1 changed files with 8 additions and 4 deletions

View File

@ -10,12 +10,16 @@ from .models import Employee
# 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 PersonalForm(ModelForm): class FdbForm(ModelForm):
'''this base class provides the required css class for all forms'''
required_css_class = 'required'
class PersonalForm(FdbForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['firstname', 'lastname', 'email', 'department', 'team',] fields = ['firstname', 'lastname', 'email', 'department', 'team',]
class WorkingForm(ModelForm): class WorkingForm(FdbForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german', fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german',
@ -23,14 +27,14 @@ class WorkingForm(ModelForm):
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(ModelForm): class ITForm(FdbForm):
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(ModelForm): class OfficeForm(FdbForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['transponder', 'post_office_box',] fields = ['transponder', 'post_office_box',]