From 7f21d10c26d6a983f7bb42f739456d225cab5bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Fri, 1 Nov 2024 14:02:07 +0100 Subject: [PATCH] =?UTF-8?q?Ha,=20tak=20jsem=20se=20n=C4=9Bkde=20zamotal=20?= =?UTF-8?q?do=20import=20cyklu=20a=20musel=20jsem=20ReseniNode=20d=C3=A1t?= =?UTF-8?q?=20tam,=20kam=20pat=C5=99=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/models/__init__.py | 1 - seminar/models/odevzdavatko.py | 20 -------------------- seminar/models/treenode.py | 17 +++++++++++++++++ treenode/models/__init__.py | 1 - 4 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 seminar/models/odevzdavatko.py diff --git a/seminar/models/__init__.py b/seminar/models/__init__.py index 95e449ab..4b57e025 100644 --- a/seminar/models/__init__.py +++ b/seminar/models/__init__.py @@ -1,5 +1,4 @@ from .tvorba import * -from .odevzdavatko import * from .base import * from .pomocne import * from .treenode import * diff --git a/seminar/models/odevzdavatko.py b/seminar/models/odevzdavatko.py deleted file mode 100644 index 6079a708..00000000 --- a/seminar/models/odevzdavatko.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.db import models - -from treenode import models as tm -from odevzdavatko.models import Reseni - -class ReseniNode(tm.TreeNode): - class Meta: - db_table = 'seminar_nodes_otistene_reseni' - verbose_name = 'Otištěné řešení (Node)' - verbose_name_plural = 'Otištěná řešení (Node)' - reseni = models.ForeignKey(Reseni, - on_delete=models.PROTECT, - verbose_name = 'reseni') - - def aktualizuj_nazev(self): - self.nazev = "ReseniNode: "+str(self.reseni) - - def getOdkazStr(self): - return str(self.reseni) - diff --git a/seminar/models/treenode.py b/seminar/models/treenode.py index eee40281..8600c4b4 100644 --- a/seminar/models/treenode.py +++ b/seminar/models/treenode.py @@ -9,6 +9,7 @@ from unidecode import unidecode # Používám pro získání ID odkazu (ještě from polymorphic.models import PolymorphicModel from personalni.models import Organizator +from odevzdavatko.models import Reseni from .pomocne import Text @@ -263,3 +264,19 @@ class CastNode(TreeNode): def getOdkazStr(self): return str(self.nadpis) + + +class ReseniNode(TreeNode): + class Meta: + db_table = 'seminar_nodes_otistene_reseni' + verbose_name = 'Otištěné řešení (Node)' + verbose_name_plural = 'Otištěná řešení (Node)' + reseni = models.ForeignKey(Reseni, + on_delete=models.PROTECT, + verbose_name = 'reseni') + + def aktualizuj_nazev(self): + self.nazev = "ReseniNode: "+str(self.reseni) + + def getOdkazStr(self): + return str(self.reseni) diff --git a/treenode/models/__init__.py b/treenode/models/__init__.py index f068a819..36b2521c 100644 --- a/treenode/models/__init__.py +++ b/treenode/models/__init__.py @@ -1,2 +1 @@ -from seminar.models.odevzdavatko import * from seminar.models.treenode import *