From 70b849ffd65418fe05fb53ae1802090233deb740 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 8 Feb 2021 12:19:54 +0100 Subject: [PATCH] added field "intern/extern" --- evapp/forms.py | 2 +- evapp/migrations/0004_employee_intern.py | 18 ++++++++++++++++++ evapp/models.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 evapp/migrations/0004_employee_intern.py diff --git a/evapp/forms.py b/evapp/forms.py index 60f2cf5..7dc45b3 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -27,7 +27,7 @@ class PersonalForm(EvaForm): class Meta: model = Employee - fields = ['firstname', 'lastname', 'email', 'department', 'team', ] + fields = ['firstname', 'lastname', 'intern', 'email', 'department', 'team', ] class WorkingForm(EvaForm): class Meta: diff --git a/evapp/migrations/0004_employee_intern.py b/evapp/migrations/0004_employee_intern.py new file mode 100644 index 0000000..5a233eb --- /dev/null +++ b/evapp/migrations/0004_employee_intern.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.4 on 2021-02-08 11:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('evapp', '0003_auto_20210114_1357'), + ] + + operations = [ + migrations.AddField( + model_name='employee', + name='intern', + field=models.BooleanField(default=True, verbose_name='Interne_r Mitarbeiter_in?'), + ), + ] diff --git a/evapp/models.py b/evapp/models.py index 487e221..8e1cf14 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -42,6 +42,7 @@ class Employee(models.Model): # personal data firstname = models.CharField(max_length=50, verbose_name="Vorname") lastname = models.CharField(max_length=50, verbose_name="Nachname") + intern = models.BooleanField(verbose_name='Interne_r Mitarbeiter_in?', default=True) email = models.CharField(max_length=50, verbose_name="E-Mail-Adresse") department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items()) team = models.CharField(max_length=20, null=True, blank=True)