|
|
@ -238,7 +238,7 @@ class TreeLibError(RuntimeError): |
|
|
|
|
|
|
|
# Editace stromu: |
|
|
|
def create_node_after(predecessor, type, **kwargs): |
|
|
|
from seminar.models.treenode import TreeNode |
|
|
|
from .models import TreeNode |
|
|
|
if predecessor is None: |
|
|
|
raise TreeLibError("Nelze vyrábět sirotky! (predecessor=None)") |
|
|
|
if not issubclass(type, TreeNode): |
|
|
@ -255,7 +255,7 @@ def create_node_after(predecessor, type, **kwargs): |
|
|
|
|
|
|
|
# Vyrábí prvního syna, ostatní nalepí za (existují-li) |
|
|
|
def create_child(parent, type, **kwargs): |
|
|
|
from seminar.models.treenode import TreeNode |
|
|
|
from .models import TreeNode |
|
|
|
if parent is None: |
|
|
|
raise TreeLibError("Nelze vyrábět sirotky! (parent=None)") |
|
|
|
if not issubclass(type, TreeNode): |
|
|
@ -293,7 +293,7 @@ def insert_last_child(parent, node): |
|
|
|
last.save() |
|
|
|
|
|
|
|
def create_node_before(successor, type, **kwargs): |
|
|
|
from seminar.models.treenode import TreeNode |
|
|
|
from .models import TreeNode |
|
|
|
if successor is None: |
|
|
|
raise TreeLibError("Nelze vyrábět sirotky! (successor=None)") |
|
|
|
if not issubclass(type, TreeNode): |
|
|
|