From 707ce532b6cc75d537d0844522925d77b5fa8921 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 4 May 2021 15:35:27 +0200 Subject: [PATCH] laptop removed --- evapp/forms.py | 2 +- evapp/migrations/0019_auto_20210504_1333.py | 22 +++++++++++++++++++++ evapp/models.py | 10 +--------- evapp/views.py | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 evapp/migrations/0019_auto_20210504_1333.py diff --git a/evapp/forms.py b/evapp/forms.py index 3a543a1..5e18c0b 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -50,7 +50,7 @@ class ITForm(EvaForm): class Meta: model = Employee fields = [ - 'laptop', 'vendor', 'os', 'keyboard', 'screen', 'mobile', 'sim', 'comment', + 'vendor', 'os', 'keyboard', 'screen', 'mobile', 'sim', 'comment', 'language', 'accounts', 'lists', 'rebu2go' ] class OfficeForm(EvaForm): diff --git a/evapp/migrations/0019_auto_20210504_1333.py b/evapp/migrations/0019_auto_20210504_1333.py new file mode 100644 index 0000000..ad316d2 --- /dev/null +++ b/evapp/migrations/0019_auto_20210504_1333.py @@ -0,0 +1,22 @@ +# Generated by Django 3.1.4 on 2021-05-04 13:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('evapp', '0018_auto_20210504_1251'), + ] + + operations = [ + migrations.RemoveField( + model_name='employee', + name='laptop', + ), + migrations.AlterField( + model_name='employee', + name='vendor', + field=models.CharField(choices=[('STANDARD', 'Dell Latitude'), ('LENOVO', 'Lenovo Thinkpad'), ('MAC', 'Mac (nur für Grafiker_innen)')], default='STANDARD', max_length=8, verbose_name='Hersteller'), + ), + ] diff --git a/evapp/models.py b/evapp/models.py index 9fc13dc..a7913ff 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -11,20 +11,13 @@ DEPARTMENT_CHOICES = {'PROG': 'Programme', 'CENT': 'Central', 'VOR': 'Vorstand',} -LAPTOP_CHOICES = {'14': '14", Unser Standardgerät', - '12': '12,5", Geeignet für Vielreisende',} - VENDOR_CHOICES = {'STANDARD': 'Dell Latitude', 'LENOVO': 'Lenovo Thinkpad', - 'MAC': 'Mac (nur in Ausnahmefällen)'} + 'MAC': 'Mac (nur für Grafiker_innen)'} OS_CHOICES = {'UBU': 'Ubuntu (Standard)', 'WIN': 'Windows (bitte Begründung angeben)',} -# MOBILE_CHOICES = {'NO': 'Kein Mobiltelefon', -# 'SIMPLE': 'Einfaches Gerät für Erreichbarkeit', -# 'SINGLE': 'Smartphone, Single SIM', -# 'DUAL': 'Smartphone, Dual SIM',} LANG_CHOICES = {'GER': 'Deutsch', 'ENG': 'English',} @@ -66,7 +59,6 @@ class Employee(models.Model): desk = models.CharField(max_length=100, null=True, blank=True, verbose_name="Wo soll der Arbeitsplatz sein?") # 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', verbose_name='Betriebssystem') screen = models.BooleanField(default=False, verbose_name='Zusätzlicher Monitor? Einer ist standard.') diff --git a/evapp/views.py b/evapp/views.py index 0bfef77..e606561 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -11,7 +11,7 @@ from django.shortcuts import render from django.conf import settings from django.contrib.auth.mixins import LoginRequiredMixin -from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ +from .models import Employee, DEPARTMENT_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\ ChangeForm, TYPE_CHOICES @@ -165,7 +165,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): ''' # update values in data dictionary with keys from *_CHOICES if present there - choices = {**DEPARTMENT_CHOICES, **LAPTOP_CHOICES, **TRANSPONDER_CHOICES, + choices = {**DEPARTMENT_CHOICES, **TRANSPONDER_CHOICES, **OS_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES, **KEYBOARD_CHOICES} data.update({k:choices[v] for k,v in data.items() \ if isinstance(v,collections.abc.Hashable) \