From b4cc6c738997c8b236510e5ebcb347fe4b1af3d0 Mon Sep 17 00:00:00 2001 From: Mee Date: Thu, 16 May 2019 22:22:41 +0200 Subject: [PATCH 1/3] Seminar/Migr 0051: spaces -> tabs --- seminar/migrations/0051_resitel_to_osoba.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/seminar/migrations/0051_resitel_to_osoba.py b/seminar/migrations/0051_resitel_to_osoba.py index 461aad1b..fc7d45fc 100644 --- a/seminar/migrations/0051_resitel_to_osoba.py +++ b/seminar/migrations/0051_resitel_to_osoba.py @@ -30,9 +30,10 @@ def resitel_to_osoba(apps,schema_editor): class Migration(migrations.Migration): - dependencies = [ - ('seminar', '0050_auto_20190510_2228'), - ] + dependencies = [ + ('seminar', '0050_auto_20190510_2228'), + ] - operations = [ - ] + operations = [ + + ] From 7ae36a11a7acd6f48ccf02d61019b38ca4df71ff Mon Sep 17 00:00:00 2001 From: Mee Date: Thu, 16 May 2019 22:24:39 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20migrace=20=C5=99e=C5=A1itele=20na=20O?= =?UTF-8?q?sobu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/migrations/0051_resitel_to_osoba.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/migrations/0051_resitel_to_osoba.py b/seminar/migrations/0051_resitel_to_osoba.py index fc7d45fc..1bf6f574 100644 --- a/seminar/migrations/0051_resitel_to_osoba.py +++ b/seminar/migrations/0051_resitel_to_osoba.py @@ -7,7 +7,7 @@ from django.db import migrations def resitel_to_osoba(apps,schema_editor): Resitel = apps.get_model('seminar','Resitel') Osoba = apps.get_model('seminar','Osoba') - for r in Resitel.object.all(): + for r in Resitel.objects.all(): o = Osoba() o.datum_narozeni = r.datum_narozeni o.datum_registrace = r.datum_prihlaseni @@ -35,5 +35,5 @@ class Migration(migrations.Migration): ] operations = [ - + migrations.RunPython(resitel_to_osoba), ] From 9e716d50a5cf1c5c5730480f4991773e47999985 Mon Sep 17 00:00:00 2001 From: Mee Date: Thu, 16 May 2019 22:33:22 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Migrace=20=C5=99e=C5=A1itel=20->=20osoba:?= =?UTF-8?q?=20p=C5=99id=C3=A1na=20reverzn=C3=AD=20migrace=20(neotestovan?= =?UTF-8?q?=C3=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/migrations/0051_resitel_to_osoba.py | 25 +++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/seminar/migrations/0051_resitel_to_osoba.py b/seminar/migrations/0051_resitel_to_osoba.py index 1bf6f574..f71d88eb 100644 --- a/seminar/migrations/0051_resitel_to_osoba.py +++ b/seminar/migrations/0051_resitel_to_osoba.py @@ -26,7 +26,28 @@ def resitel_to_osoba(apps,schema_editor): o.save() r.osoba = o r.save() - + +def osoba_to_resitel(apps, schema_editor): + Resitel = apps.get_model('seminar','Resitel') + Osoba = apps.get_model('seminar','Osoba') + for r in Resitel.objects.all(): + o = r.osoba + r.datum_narozeni = o.datum_narozeni + r.datum_prihlaseni = o.datum_registrace + r.datum_souhlasu_udaje = o.datum_souhlasu_udaje + r.datum_souhlasu_zasilani = o.datum_souhlasu_zasilani + r.email = o.email + r.jmeno = o.jmeno + r.mesto = o.mesto + r.pohlavi_muz = o.pohlavi_muz + r.prijmeni = o.prijmeni + r.psc = o.psc + r.stat = o.stat + r.telefon = o.telefon + r.ulice = o.ulice + r.user = o.user + r.save() + o.delete() class Migration(migrations.Migration): @@ -35,5 +56,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(resitel_to_osoba), + migrations.RunPython(resitel_to_osoba, osoba_to_resitel), ]