Ha, tak jsem se někde zamotal do import cyklu a musel jsem ReseniNode dát tam, kam patří
This commit is contained in:
parent
dc0ff80632
commit
7f21d10c26
4 changed files with 17 additions and 22 deletions
|
@ -1,5 +1,4 @@
|
||||||
from .tvorba import *
|
from .tvorba import *
|
||||||
from .odevzdavatko import *
|
|
||||||
from .base import *
|
from .base import *
|
||||||
from .pomocne import *
|
from .pomocne import *
|
||||||
from .treenode import *
|
from .treenode import *
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
|
@ -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 polymorphic.models import PolymorphicModel
|
||||||
|
|
||||||
from personalni.models import Organizator
|
from personalni.models import Organizator
|
||||||
|
from odevzdavatko.models import Reseni
|
||||||
|
|
||||||
from .pomocne import Text
|
from .pomocne import Text
|
||||||
|
|
||||||
|
@ -263,3 +264,19 @@ class CastNode(TreeNode):
|
||||||
|
|
||||||
def getOdkazStr(self):
|
def getOdkazStr(self):
|
||||||
return str(self.nadpis)
|
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)
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
from seminar.models.odevzdavatko import *
|
|
||||||
from seminar.models.treenode import *
|
from seminar.models.treenode import *
|
||||||
|
|
Loading…
Reference in a new issue