Caching: Initial experitmental cache model
signed-off-by: Roberto Rosario <rosarior@t60.lan>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import apps
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .literals import DEFAULT_DOCUMENT_TYPE_LABEL
|
||||
from .signals import post_initial_document_type
|
||||
@@ -21,6 +22,14 @@ def create_default_document_type(sender, **kwargs):
|
||||
)
|
||||
|
||||
|
||||
def handler_create_document_cache(sender, **kwargs):
|
||||
Cache = apps.get_model(app_label='common', model_name='Cache')
|
||||
Cache.objects.get_or_create(
|
||||
name='document_images', label=_('Document images'),
|
||||
storage_instance_path='documents.storages.storage_documentimagecache'
|
||||
)
|
||||
|
||||
|
||||
def handler_scan_duplicates_for(sender, instance, **kwargs):
|
||||
task_scan_duplicates_for.apply_async(
|
||||
kwargs={'document_id': instance.document.pk}
|
||||
|
||||
Reference in New Issue
Block a user