eva/evapp/forms.py

46 lines
1.4 KiB
Python

from django.db import models
from django.forms import ModelForm, DateInput, Form
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 DummyForm(Form):
class Meta:
model = Employee
fields = '__all__'
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',]