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.
37 lines
932 B
37 lines
932 B
# Generated by Django 2.2.5 on 2019-09-26 19:35
|
|
|
|
from django.db import migrations, models
|
|
|
|
def fix_all_names(apps,schema_editor):
|
|
for objtype in [
|
|
"RocnikNode",
|
|
"CisloNode",
|
|
"MezicisloNode",
|
|
"TemaVCisleNode",
|
|
"KonferaNode",
|
|
"ClanekNode",
|
|
"UlohaZadaniNode",
|
|
"PohadkaNode",
|
|
"UlohaVzorakNode",
|
|
"TextNode",
|
|
]:
|
|
Objects = apps.get_model('seminar', objtype)
|
|
for obj in Objects.objects.all():
|
|
obj.aktualizuj_nazev()
|
|
# Better save than sorry
|
|
obj.save()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('seminar', '0001_reset'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='treenode',
|
|
name='nazev',
|
|
field=models.TextField(help_text='Tento název se zobrazuje v nabídkách pro výběr vhodného TreeNode', null=True, verbose_name='název tohoto node'),
|
|
),
|
|
migrations.RunPython(fix_all_names),
|
|
]
|
|
|