Wrap storages directly connected to file model fields to avoid
Django triggering a migration change when an attribute of the
storage is changed, like the location.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Extract the new smart file caching code from the common app
and convert it into its own new app called file_caching.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.
This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.
Every app reference is now prepended with 'mayan.apps'.
Existing config.yml files need to be updated manually.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Execute the prune method of a cache when its properties
are changed. This ensures the size of the cache matches
the maximum size set when last saved.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add retry to race condition in intermediate image generation.
Remove DB index from cache file size field.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Working implementation with three levels of organization per cache.
Cache -> Partition -> File.
Current non blocking lock for the intermediate file generation needs
to be replaced to a blocking lock.
Needs tests.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Replace all __unicode__ methods to __str__ and the
@python_2_unicode_compatible decorator.
Replace all instance of smart_str, smart_unicode, force_uncode
with force_text.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>