diff --git a/evapp/forms.py b/evapp/forms.py index 2f73f54..68b1d16 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -1,5 +1,5 @@ from django.db import models -from django.forms import ModelForm, DateInput, Form +from django.forms import ModelForm, DateInput, Form, ChoiceField, RadioSelect from .models import Employee @@ -19,7 +19,12 @@ class FdbForm(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): + choice = ChoiceField(choices=TYPE_CHOICES.items(), widget=RadioSelect, + label='Welcher Prozess soll angestoßen werden?') + class Meta: model = Employee fields = ['firstname', 'lastname', 'email', 'department', 'team',]