|
@ -1152,6 +1152,14 @@ class TreeNode(models.Model): |
|
|
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") |
|
|
|
|
|
|
|
|
|
|
|
def print_tree(self,indent=0): |
|
|
|
|
|
print("{}TreeNode({})".format(" "*indent,self.id)) |
|
|
|
|
|
if self.first_child: |
|
|
|
|
|
self.first_child.print_tree(indent=indent+2) |
|
|
|
|
|
if self.succ: |
|
|
|
|
|
self.succ.print_tree(indent=indent) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RocnikNode(TreeNode): |
|
|
class RocnikNode(TreeNode): |
|
|
class Meta: |
|
|
class Meta: |
|
|