From 74eacb26c5d768474f4a18c988262bf38a323f11 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 21 Oct 2020 13:10:08 +0200 Subject: [PATCH] fixed accounts choices --- input/migrations/0016_project_account.py | 18 ++++++++++++++++++ input/models.py | 2 +- input/settings.py | 2 -- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 input/migrations/0016_project_account.py diff --git a/input/migrations/0016_project_account.py b/input/migrations/0016_project_account.py new file mode 100644 index 0000000..2ee7884 --- /dev/null +++ b/input/migrations/0016_project_account.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.1 on 2020-10-21 11:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0015_auto_20201021_0721'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='account', + field=models.CharField(choices=[('21103', '21103 Willkommen'), ('21111', '21111 Förderung'), ('21112', '21112 WikiCon'), ('21113', '21113 Wikimania/Unterstützung Ehrenamtliche'), ('21115', '21115 Lokale Räume, Berlin'), ('21116', '21116 Lokale Räume, Hamburg'), ('21117', '21117 Lokale Räume, Hannover'), ('21118', '21118 Lokale Räume, Köln'), ('21119', '21119 Lokale Räume, München'), ('21120', '21120 Lokale Räume, Fürth'), ('21125', '21125 Lokale Räume, allgemein'), ('21134', '21134 Größe'), ('21137', '21137 Beitragen'), ('21138', '21138 Vermittlung')], max_length=5, null=True), + ), + ] diff --git a/input/models.py b/input/models.py index 596eb96..624e2dc 100644 --- a/input/models.py +++ b/input/models.py @@ -20,7 +20,7 @@ class Volunteer(models.Model): class Project(Volunteer): name = models.CharField(max_length=200) start = models.DateField('start date') - account = models.CharField(max_length=5, choices=ACCOUNTS.items()) + account = models.CharField(max_length=5, choices=ACCOUNTS.items(), null=True) pid = models.IntegerField(null=True, blank=True) # automaticly generated diff --git a/input/settings.py b/input/settings.py index 9f1effe..98b0c74 100644 --- a/input/settings.py +++ b/input/settings.py @@ -24,5 +24,3 @@ ACCOUNTS ={"21103": '21103 Willkommen', "21134": '21134 Größe', "21137": '21137 Beitragen', "21138": '21138 Vermittlung',} - -#ACCOUNTS_LIST = [(k, v) for k, v in ACCOUNTS_DICT.iteritems()]