From 5df881fa75522a4dba9f8302595212769d1ae807 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 20 Jan 2021 11:02:22 +0100 Subject: [PATCH] new radiobutton for E/V/A. no functionality at the moment --- evapp/forms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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',]