Smazána migrace 0054
Bude ekvivalentní 0058
This commit is contained in:
parent
70f29f51bb
commit
5809dc899b
2 changed files with 1 additions and 52 deletions
|
@ -1,51 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.20 on 2019-05-17 17:44
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def uloha_to_Uloha(apps,schema_editor):
|
||||
Problem = apps.get_model('seminar', 'Problem')
|
||||
Uloha = apps.get_model('seminar', 'Uloha')
|
||||
Text = apps.get_model('seminar', 'Text')
|
||||
|
||||
ulohy = Problem.objects.filter(typ = 'uloha')
|
||||
for uold in ulohy:
|
||||
zadani = Text.objects.create(na_web = uold.text_zadani)
|
||||
vzorak = Text.objects.create(na_web = uold.text_reseni)
|
||||
unew = Uloha.objects.create(
|
||||
nazev = uold.nazev,
|
||||
stav = uold.stav,
|
||||
zamereni = uold.zamereni,
|
||||
poznamka = uold.poznamka,
|
||||
zadani = zadani,
|
||||
vzorak = vzorak,
|
||||
autor = uold.autor,
|
||||
kod = uold.kod,
|
||||
cislo_zadani = uold.cislo_zadani_old,
|
||||
cislo_reseni = uold.cislo_reseni_old,
|
||||
max_body = uold.body,
|
||||
vytvoreno = uold.vytvoreno,
|
||||
)
|
||||
unew.opravovatele.add(*uold.opravovatele.all())
|
||||
unew.save()
|
||||
|
||||
def tema_to_Tema(apps, schema_editor):
|
||||
Problem = apps.get_model('seminar', 'Problem')
|
||||
Tema = apps.get_model('seminar', 'Tema')
|
||||
Text = apps.get_model('seminar', 'Text')
|
||||
|
||||
temata = Problem.objects.filter(typ = 'tema')
|
||||
# Bordel bordel bordel. Téma nemá zadání, je potřeba vyrobit TemaVCisleNode
|
||||
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0053_organizator_organizuje_od_do'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(uloha_to_Uloha),
|
||||
]
|
|
@ -8,7 +8,7 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0054_problem_to_uloha_tema_clanek'),
|
||||
('seminar', '0053_organizator_organizuje_od_do'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
|
Loading…
Reference in a new issue