Reorganize and sort models and managers according to Mayan's best practices.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-13 15:56:40 -04:00
committed by Roberto Rosario
parent a172538dfc
commit 28aa0b913c
21 changed files with 418 additions and 418 deletions

View File

@@ -9,13 +9,13 @@ class DocumentIndexInstanceNodeManager(models.Manager):
class IndexManager(models.Manager):
def get_by_natural_key(self, name):
return self.get(name=name)
def index_document(self, document):
for index in self.filter(enabled=True, document_types=document.document_type):
index.index_document(document=document)
def get_by_natural_key(self, name):
return self.get(name=name)
def rebuild(self):
for index in self.all():
index.rebuild()