From 1b045fb77d1d74399430bad3c7f98874d828f963 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 3 Nov 2021 13:43:40 +0100 Subject: [PATCH] fixture added to fix deployment problem with key constraints --- TODO | 3 ++ input/fixtures/accounts.json | 1 + input/migrations/0062_auto_20210707_1314.py | 25 ----------- input/migrations/0062_auto_20211103_1155.py | 41 +++++++++++++++++++ input/migrations/0063_auto_20210708_0553.py | 23 ----------- input/migrations/0064_alter_accounts_code.py | 18 -------- .../0065_rename_accounts_account.py | 17 -------- input/migrations/0066_project_finance_id.py | 18 -------- .../0067_project_project_of_year.py | 18 -------- input/models.py | 2 +- 10 files changed, 46 insertions(+), 120 deletions(-) create mode 100644 input/fixtures/accounts.json delete mode 100644 input/migrations/0062_auto_20210707_1314.py create mode 100644 input/migrations/0062_auto_20211103_1155.py delete mode 100644 input/migrations/0063_auto_20210708_0553.py delete mode 100644 input/migrations/0064_alter_accounts_code.py delete mode 100644 input/migrations/0065_rename_accounts_account.py delete mode 100644 input/migrations/0066_project_finance_id.py delete mode 100644 input/migrations/0067_project_project_of_year.py diff --git a/TODO b/TODO index bf3b23d..b674cc1 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,8 @@ + known bugs: +- https://srcsrv.wikimedia.de/beba/foerderbarometer/issues/1 + - helptext by /intern email: "Bitte gib deine E-Mail-Adresse ein, damit dich Wikimedia Deutschland bei Rückfragen oder für die Zusage kontaktieren kann." maybe this this misleading? diff --git a/input/fixtures/accounts.json b/input/fixtures/accounts.json new file mode 100644 index 0000000..e78a5e2 --- /dev/null +++ b/input/fixtures/accounts.json @@ -0,0 +1 @@ +[{"model": "input.account", "pk": "21111", "fields": {"description": "21111 Förderung (reaktiv)"}}, {"model": "input.account", "pk": "21112", "fields": {"description": "21112 WikiCon"}}, {"model": "input.account", "pk": "21115", "fields": {"description": "21115 Lokale Räume, Berlin"}}, {"model": "input.account", "pk": "21116", "fields": {"description": "21116 Lokale Räume, Hamburg"}}, {"model": "input.account", "pk": "21117", "fields": {"description": "Lokale Räume, Hannover"}}, {"model": "input.account", "pk": "21118", "fields": {"description": "21118 Lokale Räume, Köln"}}, {"model": "input.account", "pk": "21119", "fields": {"description": "21119 Lokale Räume, München"}}, {"model": "input.account", "pk": "21120", "fields": {"description": "21120 Lokale Räume, Fürth"}}, {"model": "input.account", "pk": "21125", "fields": {"description": "21125 Lokale Räume, allgemein"}}, {"model": "input.account", "pk": "21130", "fields": {"description": "21130 GLAM-Förderung"}}, {"model": "input.account", "pk": "21131", "fields": {"description": "21131 Initiative Förderung"}}, {"model": "input.account", "pk": "21140", "fields": {"description": "21140 Wikipedia-Kampagne"}}, {"model": "input.account", "pk": "21141", "fields": {"description": "21141 Wikipedia-Onboarding"}}, {"model": "input.account", "pk": "21150", "fields": {"description": "21150 Fürsorge und Online-Kommunikationskultur"}}] \ No newline at end of file diff --git a/input/migrations/0062_auto_20210707_1314.py b/input/migrations/0062_auto_20210707_1314.py deleted file mode 100644 index 6e5279e..0000000 --- a/input/migrations/0062_auto_20210707_1314.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-07 13:14 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0061_concretevolunteer'), - ] - - operations = [ - migrations.CreateModel( - name='Accounts', - fields=[ - ('acc', models.CharField(choices=[('DEF', 'DEFAULT VALUE, you hould not see this!'), ('21111', '21111 Förderung (reaktiv)'), ('21112', '21112 WikiCon'), ('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'), ('21130', '21130 GLAM-Förderung'), ('21131', '21131 Initiative Förderung'), ('21140', '21140 Wikipedia-Kampagne'), ('21141', '21141 Wikipedia-Onboarding'), ('21150', '21150 Fürsorge und Online-Kommunikationskultur')], default='DEF', max_length=5, primary_key=True, serialize=False, verbose_name='Kostenstelle')), - ], - ), - migrations.AlterField( - model_name='project', - name='account', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='input.accounts'), - ), - ] diff --git a/input/migrations/0062_auto_20211103_1155.py b/input/migrations/0062_auto_20211103_1155.py new file mode 100644 index 0000000..0625878 --- /dev/null +++ b/input/migrations/0062_auto_20211103_1155.py @@ -0,0 +1,41 @@ +# Generated by Django 3.2.5 on 2021-11-03 11:55 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0061_concretevolunteer'), + ] + + operations = [ + migrations.CreateModel( + name='Account', + fields=[ + ('code', models.CharField(default='DEF', max_length=5, primary_key=True, serialize=False, verbose_name='Kostenstelle')), + ('description', models.CharField(default='NO DESCRIPTION', max_length=60, verbose_name='Beschreibung')), + ], + ), + migrations.AddField( + model_name='project', + name='finance_id', + field=models.CharField(blank=True, max_length=15, null=True), + ), + migrations.AddField( + model_name='project', + name='project_of_year', + field=models.IntegerField(default=0), + ), + migrations.AlterField( + model_name='library', + name='type', + field=models.CharField(choices=[('BIB', 'Bibliotheksstipendium'), ('ELIT', 'eLiteraturstipendium'), ('MAIL', 'E-Mail-Adresse'), ('IFG', 'Kostenübernahme IFG-Anfrage'), ('LIT', 'Literaturstipendium'), ('LIST', 'Mailingliste'), ('SOFT', 'Softwarestipendium'), ('VIS', 'Visitenkarten')], default='BIB', max_length=4), + ), + migrations.AlterField( + model_name='project', + name='account', + field=models.ForeignKey(db_constraint=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='input.account'), + ), + ] diff --git a/input/migrations/0063_auto_20210708_0553.py b/input/migrations/0063_auto_20210708_0553.py deleted file mode 100644 index cba8e8f..0000000 --- a/input/migrations/0063_auto_20210708_0553.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-08 05:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0062_auto_20210707_1314'), - ] - - operations = [ - migrations.RenameField( - model_name='accounts', - old_name='acc', - new_name='code', - ), - migrations.AddField( - model_name='accounts', - name='description', - field=models.CharField(default='NO DESCRIPTION', max_length=30, verbose_name='Beschreibung'), - ), - ] diff --git a/input/migrations/0064_alter_accounts_code.py b/input/migrations/0064_alter_accounts_code.py deleted file mode 100644 index 3ffaeab..0000000 --- a/input/migrations/0064_alter_accounts_code.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-08 05:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0063_auto_20210708_0553'), - ] - - operations = [ - migrations.AlterField( - model_name='accounts', - name='code', - field=models.CharField(default='DEF', max_length=5, primary_key=True, serialize=False, verbose_name='Kostenstelle'), - ), - ] diff --git a/input/migrations/0065_rename_accounts_account.py b/input/migrations/0065_rename_accounts_account.py deleted file mode 100644 index 84c26c9..0000000 --- a/input/migrations/0065_rename_accounts_account.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-08 05:58 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0064_alter_accounts_code'), - ] - - operations = [ - migrations.RenameModel( - old_name='Accounts', - new_name='Account', - ), - ] diff --git a/input/migrations/0066_project_finance_id.py b/input/migrations/0066_project_finance_id.py deleted file mode 100644 index 9a9c82e..0000000 --- a/input/migrations/0066_project_finance_id.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.5 on 2021-10-04 08:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0065_rename_accounts_account'), - ] - - operations = [ - migrations.AddField( - model_name='project', - name='finance_id', - field=models.CharField(blank=True, max_length=15, null=True), - ), - ] diff --git a/input/migrations/0067_project_project_of_year.py b/input/migrations/0067_project_project_of_year.py deleted file mode 100644 index 8bde852..0000000 --- a/input/migrations/0067_project_project_of_year.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.5 on 2021-10-04 10:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('input', '0066_project_finance_id'), - ] - - operations = [ - migrations.AddField( - model_name='project', - name='project_of_year', - field=models.CharField(blank=True, max_length=4, null=True), - ), - ] diff --git a/input/models.py b/input/models.py index fa37112..6e899b5 100644 --- a/input/models.py +++ b/input/models.py @@ -54,7 +54,7 @@ class ConcreteExtern(Extern): class Account(models.Model): code = models.CharField('Kostenstelle', max_length=5, default="DEF", null=False, primary_key = True) - description = models.CharField('Beschreibung', max_length=30, default='NO DESCRIPTION') + description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION') def __str__(self): return f"{self.code} {self.description}"