From 3073322290490675215918dbba786e6b915aefff Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 4 May 2021 14:24:25 +0200 Subject: [PATCH] nicer looking table at the end, os now with verbose_name --- evapp/migrations/0017_auto_20210504_1224.py | 18 ++++++++++++++++++ evapp/models.py | 6 ++---- evapp/templates/evapp/employee_form.html | 4 +++- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 evapp/migrations/0017_auto_20210504_1224.py diff --git a/evapp/migrations/0017_auto_20210504_1224.py b/evapp/migrations/0017_auto_20210504_1224.py new file mode 100644 index 0000000..d5d96f9 --- /dev/null +++ b/evapp/migrations/0017_auto_20210504_1224.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.4 on 2021-05-04 12:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('evapp', '0016_auto_20210504_1040'), + ] + + operations = [ + migrations.AlterField( + model_name='employee', + name='os', + field=models.CharField(choices=[('UBU', 'Ubuntu (Standard)'), ('WIN', 'Windows (bitte Begründung angeben)')], default='UBU', max_length=3, verbose_name='Betriebssystem'), + ), + ] diff --git a/evapp/models.py b/evapp/models.py index 7df00db..77b4490 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -54,9 +54,8 @@ class Employee(models.Model): 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.EmailField(max_length=50, verbose_name="E-Mail-Adresse ders Mitarbeitenden") department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items(), verbose_name='Bereich') - team = models.CharField(max_length=20, null=True, blank=True) # TODO? besser als choices? + team = models.CharField(max_length=20, null=True, blank=True) # TODO? better with choices? # general work related stuff firstdate_employment = models.DateField(null=True, verbose_name="Erster Arbeitstag") @@ -69,11 +68,10 @@ class Employee(models.Model): # IT related stuff laptop = models.CharField(max_length=2, choices=LAPTOP_CHOICES.items(), default='14') vendor = models.CharField(max_length=8, choices=VENDOR_CHOICES.items(), default='STANDARD', verbose_name='Hersteller') - os = models.CharField(max_length=3, choices=OS_CHOICES.items(), default='UBU') + os = models.CharField(max_length=3, choices=OS_CHOICES.items(), default='UBU', verbose_name='Betriebssystem') screen = models.BooleanField(default=False, verbose_name='Zusätzlicher Monitor? Einer ist standard.') mobile = models.BooleanField(max_length=6, default=False, verbose_name='Handy benötigt?') sim = models.BooleanField(default=False, verbose_name="Mobilfunkvertrag") - # landline = models.BooleanField(default=True, verbose_name="Festnetztelefon") # do we still need this? keyboard = models.CharField(max_length=2, choices=KEYBOARD_CHOICES.items(), default='DE', verbose_name="Tastaturlayout") comment = models.TextField(max_length=500, null=True, blank=True, verbose_name="zusätzliche IT-Anforderungen") language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER") diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index 1970fe8..f84b49b 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -53,9 +53,11 @@

{% if datatable == True %} + {% for key, value in data.items %} - {{ key }}: {{ value }}

+

{% endfor %} +
{{ key }}{{ value }}
{% endif %}
{% csrf_token %}