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.
30 lines
786 B
30 lines
786 B
5 years ago
|
# -*- coding: utf-8 -*-
|
||
|
# Generated by Django 1.11.20 on 2019-05-29 03:26
|
||
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.db import migrations
|
||
|
|
||
|
def vytvor_pohadkanode(apps, schema_editor):
|
||
|
Pohadka = apps.get_model('seminar', 'Pohadka')
|
||
|
PohadkaNode = apps.get_model('seminar', 'PohadkaNode')
|
||
|
Text = apps.get_model('seminar', 'Text')
|
||
|
TextNode = apps.get_model('seminar', 'TextNode')
|
||
|
|
||
|
for p in Pohadka.objects.all():
|
||
|
t = Text.objects.create(na_web = p.text)
|
||
|
t.save()
|
||
|
tn = TextNode.objects.create(text = t)
|
||
|
tn.save()
|
||
|
pn = PohadkaNode.objects.create(pohadka = p, first_child = tn)
|
||
|
pn.save()
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
('seminar', '0058_problem_to_uloha_tema_clanek'),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.RunPython(vytvor_pohadkanode),
|
||
|
]
|