Browse Source

Já to chci vidět...

middleware_test
Pavel "LEdoian" Turinsky 4 years ago
parent
commit
21a549af18
  1. 9
      seminar/migrations/0058_problem_to_uloha_tema_clanek.py

9
seminar/migrations/0058_problem_to_uloha_tema_clanek.py

@ -6,9 +6,6 @@ from django.db import migrations
from django.db.models import Q from django.db.models import Q
import logging
logger = logging.getLogger(__name__)
def poskladej_strom(apps, rodic, *texty): def poskladej_strom(apps, rodic, *texty):
Text = apps.get_model('seminar', 'Text') Text = apps.get_model('seminar', 'Text')
TextNode = apps.get_model('seminar', 'TextNode') TextNode = apps.get_model('seminar', 'TextNode')
@ -45,7 +42,7 @@ def uloha_to_Uloha(apps,schema_editor):
ulohy = Problem.objects.filter(typ = 'uloha') ulohy = Problem.objects.filter(typ = 'uloha')
for uold in ulohy: for uold in ulohy:
logger.info('u') print('u')
unew = Uloha.objects.create( unew = Uloha.objects.create(
problem_ptr = uold, problem_ptr = uold,
# Zakomentované fieldy by se už měly nacházet v příslušném problému # Zakomentované fieldy by se už měly nacházet v příslušném problému
@ -87,7 +84,7 @@ def clanek_to_Clanek(apps,schema_editor):
clanky = Problem.objects.filter(Q(typ='org-clanek') | Q(typ='res-clanek')) clanky = Problem.objects.filter(Q(typ='org-clanek') | Q(typ='res-clanek'))
for cl in clanky: for cl in clanky:
logger.info('c') print('c')
# Vybereme vhodné číslo pro článek z čísla zadání a čísla řešení: # Vybereme vhodné číslo pro článek z čísla zadání a čísla řešení:
if cl.cislo_zadani_old is None: if cl.cislo_zadani_old is None:
cislo = cl.cislo_reseni_old cislo = cl.cislo_reseni_old
@ -126,7 +123,7 @@ def tema_to_Tema(apps, schema_editor):
temata = Problem.objects.filter(Q(typ = 'tema') | Q(typ='serial')) temata = Problem.objects.filter(Q(typ = 'tema') | Q(typ='serial'))
for t in temata: for t in temata:
logger.info('t') print('t')
# Vymyslíme správně ročník: # Vymyslíme správně ročník:
if t.cislo_zadani_old is None and t.cislo_reseni_old is None: if t.cislo_zadani_old is None and t.cislo_reseni_old is None:
rocnik = None rocnik = None

Loading…
Cancel
Save