chol
/
eva
forked from tohe/eva
1
0
Fork 0

laptop removed

This commit is contained in:
Benni Bärmann 2021-05-04 15:35:27 +02:00
parent db36e1cdc9
commit 707ce532b6
4 changed files with 26 additions and 12 deletions

View File

@ -50,7 +50,7 @@ class ITForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = [ fields = [
'laptop', 'vendor', 'os', 'keyboard', 'screen', 'mobile', 'sim', 'comment', 'vendor', 'os', 'keyboard', 'screen', 'mobile', 'sim', 'comment',
'language', 'accounts', 'lists', 'rebu2go' ] 'language', 'accounts', 'lists', 'rebu2go' ]
class OfficeForm(EvaForm): class OfficeForm(EvaForm):

View File

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

View File

@ -11,20 +11,13 @@ DEPARTMENT_CHOICES = {'PROG': 'Programme',
'CENT': 'Central', 'CENT': 'Central',
'VOR': 'Vorstand',} 'VOR': 'Vorstand',}
LAPTOP_CHOICES = {'14': '14", Unser Standardgerät',
'12': '12,5", Geeignet für Vielreisende',}
VENDOR_CHOICES = {'STANDARD': 'Dell Latitude', VENDOR_CHOICES = {'STANDARD': 'Dell Latitude',
'LENOVO': 'Lenovo Thinkpad', 'LENOVO': 'Lenovo Thinkpad',
'MAC': 'Mac (nur in Ausnahmefällen)'} 'MAC': 'Mac (nur für Grafiker_innen)'}
OS_CHOICES = {'UBU': 'Ubuntu (Standard)', OS_CHOICES = {'UBU': 'Ubuntu (Standard)',
'WIN': 'Windows (bitte Begründung angeben)',} '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', LANG_CHOICES = {'GER': 'Deutsch',
'ENG': 'English',} '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?") desk = models.CharField(max_length=100, null=True, blank=True, verbose_name="Wo soll der Arbeitsplatz sein?")
# IT related stuff # 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') 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') 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.')

View File

@ -11,7 +11,7 @@ from django.shortcuts import render
from django.conf import settings from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin 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 LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES
from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\ from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\
ChangeForm, TYPE_CHOICES ChangeForm, TYPE_CHOICES
@ -165,7 +165,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
''' '''
# update values in data dictionary with keys from *_CHOICES if present there # 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} **OS_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES, **KEYBOARD_CHOICES}
data.update({k:choices[v] for k,v in data.items() \ data.update({k:choices[v] for k,v in data.items() \
if isinstance(v,collections.abc.Hashable) \ if isinstance(v,collections.abc.Hashable) \