|
@ -2,6 +2,15 @@ |
|
|
|
|
|
|
|
|
from django.db import migrations, models |
|
|
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): |
|
|
class Migration(migrations.Migration): |
|
|
|
|
|
|
|
@ -24,4 +33,5 @@ class Migration(migrations.Migration): |
|
|
'managed': False, |
|
|
'managed': False, |
|
|
}, |
|
|
}, |
|
|
), |
|
|
), |
|
|
|
|
|
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes), |
|
|
] |
|
|
] |
|
|