nicer looking table at the end, os now with verbose_name

This commit is contained in:
Benni Bärmann 2021-05-04 14:24:25 +02:00
parent b2493e01b0
commit 3073322290
3 changed files with 23 additions and 5 deletions

View File

@ -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'),
),
]

View File

@ -54,9 +54,8 @@ class Employee(models.Model):
firstname = models.CharField(max_length=50, verbose_name="Vorname") firstname = models.CharField(max_length=50, verbose_name="Vorname")
lastname = models.CharField(max_length=50, verbose_name="Nachname") lastname = models.CharField(max_length=50, verbose_name="Nachname")
intern = models.BooleanField(verbose_name='Interne_r Mitarbeiter_in?', default=True) 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') 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 # general work related stuff
firstdate_employment = models.DateField(null=True, verbose_name="Erster Arbeitstag") firstdate_employment = models.DateField(null=True, verbose_name="Erster Arbeitstag")
@ -69,11 +68,10 @@ class Employee(models.Model):
# IT related stuff # IT related stuff
laptop = models.CharField(max_length=2, choices=LAPTOP_CHOICES.items(), default='14') 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') 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.') 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?') mobile = models.BooleanField(max_length=6, default=False, verbose_name='Handy benötigt?')
sim = models.BooleanField(default=False, verbose_name="Mobilfunkvertrag") 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") 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") 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") language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER")

View File

@ -53,9 +53,11 @@
</p> </p>
</h2> </h2>
{% if datatable == True %} {% if datatable == True %}
<table>
{% for key, value in data.items %} {% for key, value in data.items %}
{{ key }}: {{ value }}<p> <tr><th>{{ key }}</th><th>{{ value }}</th></tr>
{% endfor %} {% endfor %}
</table>
{% endif %} {% endif %}
<form action="" method="post"> <form action="" method="post">
{% csrf_token %} {% csrf_token %}