Split Apps: oddělení personálních modelů #43

Merged
ledoian merged 48 commits from split-apps into master 2024-04-30 23:48:36 +02:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit f41d5587fc - Show all commits

View file

@ -2,6 +2,15 @@
from django.db import migrations, models
def nastav_nove_contenttypes(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
old_ct = ContentType.objects.get_by_natural_key('seminar', 'nastaveni')
old_ct.update(appname='various')
def nastav_stare_contenttypes(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
new_ct = ContentType.objects.get_by_natural_key('various', 'nastaveni')
new_ct.update(appname='seminar')
class Migration(migrations.Migration):
@ -24,4 +33,5 @@ class Migration(migrations.Migration):
'managed': False,
},
),
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes),
]

View file

@ -37,5 +37,4 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(oprav_prava_k_nastaveni, obnov_prava_k_nastaveni),
]