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