Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
884 B
26 lines
884 B
# Generated by Django 2.2.17 on 2021-07-01 00:44
|
|
|
|
from django.db import migrations
|
|
|
|
def fix_all(apps, schema_editor):
|
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
|
for modelname in [
|
|
# Problémy:
|
|
'Tema', 'Uloha', 'Clanek',
|
|
# Konfery neexistuji, takze ani neni co nastavovat...
|
|
# TreeNody:
|
|
'RocnikNode', 'CisloNode', 'MezicisloNode', 'TemaVCisleNode', 'OrgTextNode', 'UlohaZadaniNode', 'PohadkaNode', 'UlohaVzorakNode', 'TextNode', 'CastNode', 'ReseniNode',
|
|
]:
|
|
Model = apps.get_model('seminar', modelname)
|
|
ct = ContentType.objects.get_for_model(Model)
|
|
Model.objects.update(polymorphic_ctype=ct)
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('seminar', '0094_auto_20210701_0149'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(fix_all, migrations.RunPython.noop),
|
|
]
|
|
|