41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from django.db import models
|
|
from django.forms import ModelForm, DateInput
|
|
|
|
from .models import Employee
|
|
|
|
# class EmployeeForm(ModelForm):
|
|
# class Meta:
|
|
# model = Employee
|
|
# fields = '__all__'
|
|
# widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}),
|
|
# 'firstdate_presence': DateInput(attrs={'type': 'date'}),}
|
|
|
|
class FdbForm(ModelForm):
|
|
'''this base class provides the required css class for all forms'''
|
|
required_css_class = 'required'
|
|
|
|
class PersonalForm(FdbForm):
|
|
class Meta:
|
|
model = Employee
|
|
fields = ['firstname', 'lastname', 'email', 'department', 'team',]
|
|
|
|
class WorkingForm(FdbForm):
|
|
class Meta:
|
|
model = Employee
|
|
fields = ['firstdate_employment', 'firstdate_presence', 'jobdescription_german',
|
|
'jobdescription_english', 'desk',]
|
|
widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}),
|
|
'firstdate_presence': DateInput(attrs={'type': 'date'}),}
|
|
|
|
class ITForm(FdbForm):
|
|
class Meta:
|
|
model = Employee
|
|
fields = [
|
|
'laptop', 'os', 'screen', 'mobile', 'landline', 'comment',
|
|
'language', 'accounts', 'lists', ]
|
|
|
|
class OfficeForm(FdbForm):
|
|
class Meta:
|
|
model = Employee
|
|
fields = ['transponder', 'post_office_box',]
|