Made AVAILABLE_INDEXING_FUNCTION setting a setting of the documents app instead of the filesystem_serving app
This commit is contained in:
@@ -6,6 +6,8 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.utils import proper_name
|
||||
|
||||
from storage.backends.filebasedstorage import FileBasedStorage
|
||||
|
||||
default_available_functions = {
|
||||
@@ -20,9 +22,15 @@ available_transformations = {
|
||||
'rotate': {'label':_(u'Rotate [degrees]'), 'arguments':[{'name':'degrees'}]}
|
||||
}
|
||||
|
||||
|
||||
available_indexing_functions = {
|
||||
'proper_name': proper_name
|
||||
}
|
||||
|
||||
# Definition
|
||||
AVAILABLE_FUNCTIONS = getattr(settings, 'DOCUMENTS_METADATA_AVAILABLE_FUNCTIONS', default_available_functions)
|
||||
AVAILABLE_MODELS = getattr(settings, 'DOCUMENTS_METADATA_AVAILABLE_MODELS', default_available_models)
|
||||
AVAILABLE_INDEXING_FUNCTIONS = getattr(settings, 'DOCUMENTS_INDEXING_AVAILABLE_FUNCTIONS', available_indexing_functions)
|
||||
|
||||
# Upload
|
||||
USE_STAGING_DIRECTORY = getattr(settings, 'DOCUMENTS_USE_STAGING_DIRECTORY', False)
|
||||
|
||||
@@ -12,8 +12,8 @@ from python_magic import magic
|
||||
|
||||
from dynamic_search.api import register
|
||||
from converter.api import get_page_count
|
||||
from filesystem_serving.conf.settings import AVAILABLE_INDEXING_FUNCTIONS
|
||||
|
||||
from documents.conf.settings import AVAILABLE_INDEXING_FUNCTIONS
|
||||
from documents.conf.settings import AVAILABLE_FUNCTIONS
|
||||
from documents.conf.settings import AVAILABLE_MODELS
|
||||
from documents.conf.settings import CHECKSUM_FUNCTION
|
||||
|
||||
@@ -3,16 +3,9 @@
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from common.utils import proper_name
|
||||
|
||||
available_indexing_functions = {
|
||||
'proper_name': proper_name
|
||||
}
|
||||
|
||||
|
||||
# Serving
|
||||
FILESERVING_ENABLE = getattr(settings, 'FILESYSTEM_FILESERVING_ENABLE', True)
|
||||
FILESERVING_PATH = getattr(settings, 'FILESYSTEM_FILESERVING_PATH', u'/tmp/mayan/documents')
|
||||
SLUGIFY_PATHS = getattr(settings, 'FILESYSTEM_SLUGIFY_PATHS', False)
|
||||
MAX_RENAME_COUNT = getattr(settings, 'FILESYSTEM_MAX_RENAME_COUNT', 200)
|
||||
AVAILABLE_INDEXING_FUNCTIONS = getattr(settings, 'FILESYSTEM_INDEXING_AVAILABLE_FUNCTIONS', available_indexing_functions)
|
||||
|
||||
@@ -160,6 +160,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
# Definition
|
||||
#DOCUMENTS_METADATA_AVAILABLE_FUNCTIONS = {}
|
||||
#DOCUMENTS_METADATA_AVAILABLE_MODELS = {}
|
||||
#DOCUMENTS_INDEXING_AVAILABLE_FUNCTIONS = {}
|
||||
|
||||
# Upload
|
||||
#DOCUMENTS_USE_STAGING_DIRECTORY = False
|
||||
@@ -200,7 +201,6 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
|
||||
# Serving
|
||||
#FILESYSTEM_FILESERVING_ENABLE = True
|
||||
#FILESYSTEM_INDEXING_AVAILABLE_FUNCTIONS = {}
|
||||
#FILESYSTEM_FILESERVING_PATH = u'/tmp/mayan/documents'
|
||||
#FILESYSTEM_SLUGIFY_PATHS = False
|
||||
#FILESYSTEM_MAX_RENAME_COUNT = 200
|
||||
|
||||
Reference in New Issue
Block a user