Browse Source

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

pull/43/head
Pavel 'LEdoian' Turinsky 8 months ago
parent
commit
a23daf8b97
  1. 12
      personalni/migrations/0003_initial.py

12
personalni/migrations/0003_initial.py

@ -5,6 +5,17 @@ import django.utils.timezone
import django_countries.fields import django_countries.fields
import imagekit.models.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): class Migration(migrations.Migration):
@ -16,6 +27,7 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes),
migrations.CreateModel( migrations.CreateModel(
name='Organizator', name='Organizator',
fields=[ fields=[

Loading…
Cancel
Save