Pavel "LEdoian" Turinsky
6 years ago
2 changed files with 27 additions and 5 deletions
@ -0,0 +1,22 @@ |
|||||
|
# -*- 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 oprav_pohadku(apps, schema_editor): |
||||
|
Pohadka = apps.get_model('seminar', 'Pohadka') |
||||
|
|
||||
|
for p in Pohadka.objects.all(): |
||||
|
if p.uloha_old: |
||||
|
p.uloha = p.uloha_old.uloha # Pokud to nebyla úloha, vyhodí Uloha.DoesNotExists výjimku. |
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0059_spoj_stromy'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(oprav_pohadku), |
||||
|
] |
Loading…
Reference in new issue