|
@ -1164,6 +1164,9 @@ class TreeNode(PolymorphicModel): |
|
|
blank = True, |
|
|
blank = True, |
|
|
on_delete=models.SET_NULL, |
|
|
on_delete=models.SET_NULL, |
|
|
verbose_name="další element na stejné úrovni") |
|
|
verbose_name="další element na stejné úrovni") |
|
|
|
|
|
nazev = models.TextField("název tohoto node", |
|
|
|
|
|
help_text = "Tento název se zobrazuje v nabídkách pro výběr vhodného TreeNode", |
|
|
|
|
|
blank=False, null=True) |
|
|
|
|
|
|
|
|
def print_tree(self,indent=0): |
|
|
def print_tree(self,indent=0): |
|
|
print("{}TreeNode({})".format(" "*indent,self.id)) |
|
|
print("{}TreeNode({})".format(" "*indent,self.id)) |
|
@ -1173,7 +1176,7 @@ class TreeNode(PolymorphicModel): |
|
|
self.succ.print_tree(indent=indent) |
|
|
self.succ.print_tree(indent=indent) |
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
def __str__(self): |
|
|
return "Generický TreeNode!" |
|
|
return self.nazev |
|
|
|
|
|
|
|
|
class RocnikNode(TreeNode): |
|
|
class RocnikNode(TreeNode): |
|
|
class Meta: |
|
|
class Meta: |
|
|