From d051125f8d8ee142b73ae8d82f24446d6683650e Mon Sep 17 00:00:00 2001 From: "Pavel Turinsky (DebianVM @ Zr)" Date: Tue, 8 Jun 2021 22:26:05 +0000 Subject: [PATCH] Smazan kod pro org-clanky -- stejne neexistuji --- seminar/migrations/0058_problem_to_uloha_tema_clanek.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/seminar/migrations/0058_problem_to_uloha_tema_clanek.py b/seminar/migrations/0058_problem_to_uloha_tema_clanek.py index dbab46ad..5694960c 100644 --- a/seminar/migrations/0058_problem_to_uloha_tema_clanek.py +++ b/seminar/migrations/0058_problem_to_uloha_tema_clanek.py @@ -89,7 +89,8 @@ def clanek_to_Clanek(apps,schema_editor): Text = apps.get_model('seminar', 'Text') TextNode = apps.get_model('seminar', 'TextNode') - clanky = Problem.objects.filter(Q(typ='org-clanek') | Q(typ='res-clanek')) + # XXX: Org-clanky neexistuji, tak je migrace ani nepodporuje. + clanky = Problem.objects.filter(typ='res-clanek') for cl in clanky: # Vybereme vhodné číslo pro článek z čísla zadání a čísla řešení: if cl.cislo_zadani_old is None: @@ -102,17 +103,13 @@ def clanek_to_Clanek(apps,schema_editor): raise ValueError("Různá čísla zadání a řešení u článku! (Článek: {})".format(cl.nazev)) clnew = Clanek.objects.create( - problem_ptr_id = cl.id, + problem_ptr = cl, # Problém by nemělo být potřeba upravovat cislo = cislo, # Body ignorujeme, protože už jsou v hodnocení ) clnew.save() - # Aktuálně nemáme v modelu informaci o tom, jestli je to org-článek - # nebo řešitelský článek. Aby se neztratila informace, poznamenám to do - # poznámky. - cl.poznamka += "\nTyp:\t{}".format(cl.typ) cl.save() # Vyrobíme nody: