Další pokus o migraci, I guess (po týdnu, lol)

This commit is contained in:
Pavel 'LEdoian' Turinsky 2024-03-19 21:35:52 +01:00
parent 457236c21a
commit a23daf8b97

View file

@ -5,6 +5,17 @@ import django.utils.timezone
import django_countries.fields
import imagekit.models.fields
def nastav_nove_contenttypes(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
for m in ('resitel', 'organizator', 'osoba', 'skola', 'prijemce'):
oct = ContentType.objects.filter(app_label='seminar', model=m)
oct.update(app_label='personalni')
def nastav_stare_contenttypes(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
for m in ('resitel', 'organizator', 'osoba', 'skola', 'prijemce'):
nct = ContentType.objects.filter(app_label='personalni', model=m)
nct.update(app_label='seminar')
class Migration(migrations.Migration):
@ -16,6 +27,7 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes),
migrations.CreateModel(
name='Organizator',
fields=[