From 4771a3a0d32e9e956ad996d55da6b16064da098b Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Sat, 11 May 2019 00:08:15 +0200 Subject: [PATCH] Prvni pokus o datovou migraci, netestovano. --- seminar/migrations/0051_resitel_to_osoba.py | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 seminar/migrations/0051_resitel_to_osoba.py diff --git a/seminar/migrations/0051_resitel_to_osoba.py b/seminar/migrations/0051_resitel_to_osoba.py new file mode 100644 index 00000000..461aad1b --- /dev/null +++ b/seminar/migrations/0051_resitel_to_osoba.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-05-10 20:44 +from __future__ import unicode_literals + +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(): + o = Osoba() + o.datum_narozeni = r.datum_narozeni + o.datum_registrace = r.datum_prihlaseni + o.datum_souhlasu_udaje = r.datum_souhlasu_udaje + o.datum_souhlasu_zasilani = r.datum_souhlasu_zasilani + o.email = r.email + o.jmeno = r.jmeno + o.mesto = r.mesto + o.pohlavi_muz = r.pohlavi_muz + o.prijmeni = r.prijmeni + o.psc = r.psc + o.stat = r.stat + o.telefon = r.telefon + o.ulice = r.ulice + o.user = r.user + o.save() + r.osoba = o + r.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0050_auto_20190510_2228'), + ] + + operations = [ + ]