Commit Graph

34 Commits

Author SHA1 Message Date
Roberto Rosario
442bf5dc4b Wrap storages
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>
2018-12-28 00:22:49 -04:00
Roberto Rosario
aaea84b386 Caching: Turn the new caching into its own app
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>
2018-12-08 01:38:59 -04:00
Roberto Rosario
8e69178e07 Project: Switch to full app paths
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>
2018-12-05 02:04:20 -04:00
Roberto Rosario
1515c0170f Cache: Prune the cache on property updates
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>
2018-12-04 15:46:05 -04:00
Roberto Rosario
89d3fb9922 Cache: Beta stage
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>
2018-12-03 04:26:00 -04:00
Roberto Rosario
77fc9b5831 Caching: MVP stage
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>
2018-12-02 05:00:35 -04:00
Roberto Rosario
a414b8df92 Caching: Initial experitmental cache model
signed-off-by: Roberto Rosario <rosarior@t60.lan>
2018-11-30 19:48:26 -04:00
Roberto Rosario
b04b205fb6 Add docstrings for almost all models
Also adds docstring to some managers and model methods.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-11-24 22:56:35 -04:00
Roberto Rosario
8e39016f12 Code cleanups.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-21 18:57:38 -04:00
Roberto Rosario
e18c043c1f Improve natural key handing for the Document, Metadata, DocumentMetadata, DocumentTypeOCRSetting and UserProfileLocale models.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-02 16:00:22 -04:00
Roberto Rosario
2ef31d2ec3 Rename shared upload storage from sharedupload_storage to storage_sharedupload
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-29 03:58:56 -04:00
Michael Price
424d6a5af9 Standardize the way storages are used. All apps that use storage now define their storages in the .storages modules instead of the .runtime module. The storage.backends.filebasedstorage.FileBasedStorage has been remove, instead Django's default storage is used and each app is responsible of specifying their default path.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-03 02:32:28 -04:00
Michael Price
53239385ae Add the "to=" keyword argument to all ForeignKey, ManayToMany and OneToOne Fields.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:49:04 -04:00
Roberto Rosario
eb7b189970 Add generic error log model.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-25 04:12:52 -04:00
Roberto Rosario
f09321f6ab Fix deprecation warnings for Django 1.11 and Django 2.0.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-21 00:25:18 -04:00
Roberto Rosario
6c6ca38374 Replace all instances of unicode only handling to use force_text.
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>
2017-07-05 15:03:24 -04:00
Roberto Rosario
4527563d89 PEP8 cleanups, specially E501 line too long. 2015-07-22 18:21:37 -04:00
Roberto Rosario
d5b5927c77 Reference file in storage backend by name and not by path. 2015-07-13 02:03:30 -04:00
Roberto Rosario
afafd45af9 Preserve original filename when saving. 2015-07-08 00:59:56 -04:00
Roberto Rosario
4f044cecc7 Don't use the original's filename as a path. Provide an open() method which return a proper file-like object. 2015-07-07 01:24:34 -04:00
Roberto Rosario
091dad9b45 Fix SharedUpload model field name. 2015-07-06 14:32:37 -04:00
Roberto Rosario
f0cfe314f0 PEP8 cleanups 2015-07-01 16:45:33 -04:00
Roberto Rosario
f65fb2cd6c Remove anonymous user support 2015-07-01 02:45:58 -04:00
Roberto Rosario
37b4f42afe Remove autoadmin code and move it to the external django-autoadmin package 2015-06-14 03:51:36 -04:00
Roberto Rosario
26d64c45f5 Add the @python_2_unicode_compatible to all models. Closes issue #67 2015-04-01 02:40:19 -04:00
Roberto Rosario
d59ea3ede2 Add from __future__ import unicode_literals, issue #37 2015-01-19 04:06:40 -04:00
Roberto Rosario
090302676d Implement GUI language and timezone as user preferences, issue #114 2015-01-11 17:38:47 -04:00
Roberto Rosario
099844e15d Add SharedUploadedFile model to distribute work files between Mayan nodes easier 2014-10-29 05:46:26 -04:00
Roberto Rosario
37875df7a1 Add missing imports, PEP8 cleanups 2014-10-09 20:25:55 -04:00
Roberto Rosario
3990900433 Issue #39, Fix common model messages capitalization 2014-10-08 10:23:08 -04:00
Roberto Rosario
3bed82fc16 PEP8 cleanup, unused imports, missing imports, style cleanups 2014-07-10 02:45:19 -04:00
Roberto Rosario
f2cd288574 Add anonymoususer sigleton model manager 2014-07-10 01:47:15 -04:00
Roberto Rosario
5212d84090 Remove common app's Singleton model and use django-solo's SingletonModel instead 2014-07-10 01:26:51 -04:00
Roberto Rosario
ec1745b50b Initial changes to support the new Django 1.6 project structure 2014-06-15 13:13:21 +02:00