Correctly match a new node instance to it's respective parent
This commit is contained in:
@@ -84,9 +84,7 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
|
|||||||
'expression': template_node.expression, 'exception': exc})
|
'expression': template_node.expression, 'exception': exc})
|
||||||
else:
|
else:
|
||||||
if result:
|
if result:
|
||||||
index_instance, created = IndexInstanceNode.objects.get_or_create(index_template_node=template_node, value=result)
|
index_instance, created = IndexInstanceNode.objects.get_or_create(index_template_node=template_node, value=result, parent=parent_index_instance)
|
||||||
index_instance.parent = parent_index_instance
|
|
||||||
index_instance.save()
|
|
||||||
#if created:
|
#if created:
|
||||||
try:
|
try:
|
||||||
fs_create_index_directory(index_instance)
|
fs_create_index_directory(index_instance)
|
||||||
@@ -113,7 +111,10 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
|
|||||||
|
|
||||||
for child in template_node.get_children():
|
for child in template_node.get_children():
|
||||||
children_warnings = cascade_eval(
|
children_warnings = cascade_eval(
|
||||||
eval_dict, document, child, index_instance
|
eval_dict=eval_dict,
|
||||||
|
document=document,
|
||||||
|
template_node=child,
|
||||||
|
parent_index_instance=index_instance
|
||||||
)
|
)
|
||||||
warnings.extend(children_warnings)
|
warnings.extend(children_warnings)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user