This commit is contained in:
Roberto Rosario
2014-10-08 09:42:13 -04:00
parent db2980b36a
commit e5d8f4a526

View File

@@ -8,9 +8,9 @@ from django.utils.translation import ugettext_lazy as _
from metadata.classes import MetadataClass from metadata.classes import MetadataClass
from .exceptions import MaxSuffixCountReached from .exceptions import MaxSuffixCountReached
from .filesystem import (fs_create_index_directory, fs_create_document_link, from .filesystem import (assemble_suffixed_filename, fs_create_index_directory,
fs_delete_document_link, fs_delete_index_directory, fs_create_document_link, fs_delete_document_link,
assemble_suffixed_filename) fs_delete_index_directory)
from .models import Index, IndexInstanceNode, DocumentRenameCount from .models import Index, IndexInstanceNode, DocumentRenameCount
from .settings import (AVAILABLE_INDEXING_FUNCTIONS, MAX_SUFFIX_COUNT, from .settings import (AVAILABLE_INDEXING_FUNCTIONS, MAX_SUFFIX_COUNT,
SLUGIFY_PATHS) SLUGIFY_PATHS)
@@ -27,6 +27,7 @@ def update_indexes(document):
""" """
Update or create all the index instances related to a document Update or create all the index instances related to a document
""" """
warnings = [] warnings = []
eval_dict = {} eval_dict = {}
@@ -48,6 +49,7 @@ def delete_indexes(document):
""" """
Delete all the index instances related to a document Delete all the index instances related to a document
""" """
warnings = [] warnings = []
for index_instance in document.indexinstancenode_set.all(): for index_instance in document.indexinstancenode_set.all():
@@ -77,6 +79,7 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
related index instances also recursively calling itself to evaluate related index instances also recursively calling itself to evaluate
all the index's children all the index's children
""" """
warnings = [] warnings = []
if template_node.enabled: if template_node.enabled:
try: try:
@@ -129,6 +132,7 @@ def cascade_document_remove(document, index_instance):
recusively deleting documents and empty index instances up to the recusively deleting documents and empty index instances up to the
root of the tree root of the tree
""" """
warnings = [] warnings = []
try: try:
document_rename_count = DocumentRenameCount.objects.get(index_instance_node=index_instance, document=document) document_rename_count = DocumentRenameCount.objects.get(index_instance_node=index_instance, document=document)