From bb1fb87665f81bd7d612f7dc2c8dd64aed502fbd Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 21 May 2024 21:33:42 +0200 Subject: [PATCH] =?UTF-8?q?Oprava=20migrace=20kolem=20pohlav=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0008_reforma_pohlavi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename seminar/migrations/0115_reforma_pohlavi.py => personalni/migrations/0008_reforma_pohlavi.py (88%) diff --git a/seminar/migrations/0115_reforma_pohlavi.py b/personalni/migrations/0008_reforma_pohlavi.py similarity index 88% rename from seminar/migrations/0115_reforma_pohlavi.py rename to personalni/migrations/0008_reforma_pohlavi.py index 3a0f72fd..ed0862f5 100644 --- a/seminar/migrations/0115_reforma_pohlavi.py +++ b/personalni/migrations/0008_reforma_pohlavi.py @@ -8,12 +8,12 @@ OSLOVENI_ZENSKE = 'resitelka' OSLOVENI_ZADNE = '' def pohlavi_to_osloveni(apps, schema_editor): - Osoba = apps.get_model('seminar', 'Osoba') + Osoba = apps.get_model('personalni', 'Osoba') Osoba.objects.filter(pohlavi_muz=True).update(osloveni=OSLOVENI_MUZSKE) Osoba.objects.filter(pohlavi_muz=False).update(osloveni=OSLOVENI_ZENSKE) def osloveni_to_pohlavi(apps, schema_editor): - Osoba = apps.get_model('seminar', 'Osoba') + Osoba = apps.get_model('personalni', 'Osoba') nebinarni = Osoba.objects.filter(osloveni=OSLOVENI_ZADNE) if nebinarni.count() > 0: raise Exception("Nelze odmigrovat: v databázi jsou nebinární osoby, které starý model nereprezentuje správně.") @@ -23,7 +23,7 @@ def osloveni_to_pohlavi(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('seminar', '0114_related_name_se_zmenilo_a_django_chce_migraci_tak_dostane_migraci'), + ('personalni', '0007_post_split_soustredeni'), ] operations = [