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.
 
 
 
 
 
 

29 lines
664 B

# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-28 21:46
from __future__ import unicode_literals
from django.db import migrations
def reseni_to_Reseni(apps, schema_editor):
Reseni = apps.get_model('seminar','Reseni')
Hodnoceni = apps.get_model('seminar','Hodnoceni')
for r in Reseni.objects.all():
r.resitele.add(r.resitel)
h = Hodnoceni.objects.create(body=r.body)
h.cislo_body = r.cislo_body
h.problem = r.problem
h.reseni = r
h.save()
r.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0056_vrcholy_pro_rocniky_a_cisla'),
]
operations = [
migrations.RunPython(reseni_to_Reseni)
]