Initial changes to support the new Django 1.6 project structure
This commit is contained in:
19
mayan/apps/document_indexing/tools.py
Normal file
19
mayan/apps/document_indexing/tools.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from documents.models import Document
|
||||
|
||||
from .models import Index, IndexInstanceNode, DocumentRenameCount
|
||||
from .filesystem import fs_delete_directory_recusive
|
||||
from .api import update_indexes
|
||||
|
||||
|
||||
def do_rebuild_all_indexes():
|
||||
for index in Index.objects.all():
|
||||
fs_delete_directory_recusive(index)
|
||||
|
||||
IndexInstanceNode.objects.all().delete()
|
||||
DocumentRenameCount.objects.all().delete()
|
||||
for document in Document.objects.all():
|
||||
update_indexes(document)
|
||||
|
||||
return [] # Warnings - None
|
||||
Reference in New Issue
Block a user