From 23d20bacc7e6e871fc6ff7872d48ec0760a3c097 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 23 Dec 2020 13:16:01 +0100 Subject: [PATCH] IT-part of the modell added --- README.md | 2 +- eva/settings.py | 1 + evapp/migrations/0001_initial.py | 17 ++++++++- evapp/migrations/0002_auto_20201223_1117.py | 38 --------------------- evapp/models.py | 35 +++++++++++++++++++ 5 files changed, 53 insertions(+), 40 deletions(-) delete mode 100644 evapp/migrations/0002_auto_20201223_1117.py diff --git a/README.md b/README.md index eebf240..0f97685 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ environment managing tool - use this environment and do - pip install django + pip install django django-multiselectfield - clone this repository diff --git a/eva/settings.py b/eva/settings.py index b347748..6f250e0 100644 --- a/eva/settings.py +++ b/eva/settings.py @@ -38,6 +38,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'multiselectfield', ] MIDDLEWARE = [ diff --git a/evapp/migrations/0001_initial.py b/evapp/migrations/0001_initial.py index c1c9965..6bba78b 100644 --- a/evapp/migrations/0001_initial.py +++ b/evapp/migrations/0001_initial.py @@ -1,6 +1,7 @@ -# Generated by Django 3.1.4 on 2020-12-23 11:03 +# Generated by Django 3.1.4 on 2020-12-23 12:14 from django.db import migrations, models +import multiselectfield.db.fields class Migration(migrations.Migration): @@ -20,6 +21,20 @@ class Migration(migrations.Migration): ('email', models.CharField(max_length=50, verbose_name='E-Mail-Adresse')), ('department', models.CharField(choices=[('PROG', 'Programme'), ('SOFT', 'Softwareentwicklung'), ('CENT', 'Central'), ('VOR', 'Vorstand')], max_length=5)), ('team', models.CharField(blank=True, max_length=20, null=True)), + ('firstdate_employment', models.DateField(null=True, verbose_name='erster Arbeitstag')), + ('firstdate_presence', models.DateField(null=True, verbose_name='erster Tag der Anwesenheit in der Geschäftsstelle')), + ('jobdescription_german', models.CharField(max_length=100, null=True, verbose_name='Stellenbeschreibung(deutsch)')), + ('jobdescription_english', models.CharField(max_length=100, null=True, verbose_name='job description(english)')), + ('desk', models.CharField(max_length=100, null=True, verbose_name='Wo soll der Arbeitsplatz sein?')), + ('laptop', models.CharField(choices=[('14', '14", unser Standardgerät'), ('12', '12,5", geeignet für Vielreisende')], default='14', max_length=2)), + ('os', models.CharField(choices=[('UBU', 'Ubuntu (Standard)'), ('WIN', 'Windows (bitte Begründung angeben)')], default='UBU', max_length=3)), + ('screen', models.BooleanField(default=False, verbose_name='zusätzlicher Monitor? Einer ist standard.')), + ('mobile', models.CharField(default='NO', max_length=6)), + ('landline', models.BooleanField(default=True, verbose_name='Festnetztelefon')), + ('comment', models.TextField(blank=True, max_length=500, null=True, verbose_name='zusätzliche IT-Anforderungen')), + ('language', models.CharField(choices=[('GER', 'deutsch'), ('ENG', 'english')], default='GER', max_length=3)), + ('accounts', multiselectfield.db.fields.MultiSelectField(choices=[('OTRSWMDE', 'OTRS (WMDE)'), ('OTRSFUND', 'OTRS (Fundraising)'), ('CIVIC1', 'Civic CRM (allgemein)'), ('CIVIC2', 'Civic CRM (Mailings, impliziert allgemein)'), ('FUND', 'Fundraising Netzlaufwerk'), ('WEB', 'www.wikimedia.de (edit)'), ('BLOG', 'blog.wikimedia.de (edit)'), ('FORUM', 'forum.wikimedia.de')], max_length=51, null=True)), + ('lists', models.CharField(max_length=100, null=True)), ], ), ] diff --git a/evapp/migrations/0002_auto_20201223_1117.py b/evapp/migrations/0002_auto_20201223_1117.py deleted file mode 100644 index aab079b..0000000 --- a/evapp/migrations/0002_auto_20201223_1117.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-23 11:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('evapp', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='employee', - name='desk', - field=models.CharField(max_length=100, null=True, verbose_name='Wo soll der Arbeitsplatz sein?'), - ), - migrations.AddField( - model_name='employee', - name='firstdate_employment', - field=models.DateField(null=True, verbose_name='erster Arbeitstag'), - ), - migrations.AddField( - model_name='employee', - name='firstdate_presence', - field=models.DateField(null=True, verbose_name='erster Tag der Anwesenheit in der Geschäftsstelle'), - ), - migrations.AddField( - model_name='employee', - name='jobdescription_english', - field=models.CharField(max_length=100, null=True, verbose_name='job description(english)'), - ), - migrations.AddField( - model_name='employee', - name='jobdescription_german', - field=models.CharField(max_length=100, null=True, verbose_name='Stellenbeschreibung(deutsch)'), - ), - ] diff --git a/evapp/models.py b/evapp/models.py index aee1d9b..e7433aa 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -1,10 +1,35 @@ from django.db import models +from multiselectfield import MultiSelectField DEPARTMENT_CHOICES = {'PROG': 'Programme', 'SOFT': 'Softwareentwicklung', 'CENT': 'Central', 'VOR': 'Vorstand',} +LAPTOP_CHOICES = {'14': '14", unser Standardgerät', + '12': '12,5", geeignet für Vielreisende',} + +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',} + +ACCOUNT_CHOICES = {'OTRSWMDE': 'OTRS (WMDE)', + 'OTRSFUND': 'OTRS (Fundraising)', + 'CIVIC1': 'Civic CRM (allgemein)', + 'CIVIC2': "Civic CRM (Mailings, impliziert allgemein)", + 'FUND': "Fundraising Netzlaufwerk", + 'WEB': 'www.wikimedia.de (edit)', + 'BLOG': 'blog.wikimedia.de (edit)', + 'FORUM': 'forum.wikimedia.de', + } + class Employee(models.Model): firstname = models.CharField(max_length=50, verbose_name="Vorname") lastname = models.CharField(max_length=50, verbose_name="Nachname") @@ -18,3 +43,13 @@ class Employee(models.Model): jobdescription_english = models.CharField(null=True, max_length=100, verbose_name="job description(english)") desk = models.CharField(max_length=100, null=True, verbose_name="Wo soll der Arbeitsplatz sein?") # TODO: we need an optional question for remote work here + + laptop = models.CharField(max_length=2, choices=LAPTOP_CHOICES.items(), default='14') + os = models.CharField(max_length=3, choices=OS_CHOICES.items(), default='UBU') + screen = models.BooleanField(default=False, verbose_name='zusätzlicher Monitor? Einer ist standard.') + mobile = models.CharField(max_length=6, default='NO') + landline = models.BooleanField(default=True, verbose_name="Festnetztelefon") + 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") + accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), null=True) + lists = models.CharField(max_length=100, null=True)