Commit Graph

188 Commits

Author SHA1 Message Date
Roberto Rosario
c9bb13f149 Add support for client side caching of document page images. The time
the images are cached is controlled by the new setting
DOCUMENTS_PAGE_IMAGE_CACHE_TIME which defaults to 3600 seconds (1 hour).

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-08 01:31:21 -04:00
Roberto Rosario
0626529228 Add natural key support to Document pages.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-03 18:52:13 -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
c665e75871 Improve serialization migration for the models: Document, DocumentVersion, DocumentMetadata and DocumentTypeOCRSettings
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-01 05:09:43 -04:00
Roberto Rosario
6a65544fb7 Remove some label argument from the apps module and move them to the model.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-16 15:20:45 -04:00
Roberto Rosario
d7ecdac6b0 Fix PEP8 warnings.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-06 01:26:06 -04:00
Roberto Rosario
da5445eef9 Rename the storages instance names for consistency.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-05 19:30:59 -04:00
Roberto Rosario
1d55e67b00 Create the document image cache file it is doesn't exist.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-05 19:15:27 -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
Roberto Rosario
b06918c333 Make detection and fixing of PDF orientation as experimental and
default it to being disabled.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-01 23:59:27 -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
Michael Price
de65d96fe2 Update cabinets and document_index api views docstrings. Update multi level docstrings as per Python best practices.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:27:45 -04:00
Michael Price
af85d37307 Remove documents model TODOs
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:22:51 -04:00
Michael Price
28aa0b913c Reorganize and sort models and managers according to Mayan's best practices.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:21:37 -04:00
Michael Price
d03c6b4646 Update to Fancybox 3. Update to jQuery 3.3.1. Update and simplify MayanImage class.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:13:03 -04:00
Michael Price
8590bff6e4 Convert document thumbnails, preview, image preview and staging files to template base widgets. Unify all updated widgets. Display resolution settings are now specified as width and height and not a single resolution value.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:04:05 -04:00
Roberto Rosario
3a695618c1 Add get_absolute_url method to document types.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-09-17 03:36:21 -04:00
Roberto Rosario
f0baa16cde Backport support for global and object event notification. GitLab issue #262.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-09-17 03:12:40 -04:00
Roberto Rosario
5c138c7dbc Silence the second properties edited event when the initial
version of a new document finishes processing. GitLab issue #433.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-09-05 03:27:05 -04:00
Roberto Rosario
1faa63f56c Move extension preservetation code to the model. Improve document,
version and API views to include proper mimetype and encoding.
Update respective tests. GitLab issue #415.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-15 00:18:34 -04:00
Roberto Rosario
bc07bb154d Add support for preserving the file extenstion when downloading a document
version. GitLab issue #415.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-11 01:46:26 -04:00
Roberto Rosario
0ba84f256d Convert the document version list view to item view mode.
Add document version preview and thumbnail widgets.
Update the new version upload event have the version
as the target and the document as the action object.

Backported from the development branch.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-11 00:19:26 -04:00
Roberto Rosario
5fedc2c3b0 Make document version order deterministic.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-21 17:20:58 -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
877572d2b3 Use class names for clarity.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-08 14:05:19 -04:00
Roberto Rosario
c6de76822e Add two new setting options to control the caching of page images.
DOCUMENTS_DISABLE_BASE_IMAGE_CACHE and
DOCUMENTS_DISABLE_TRANSFORMED_IMAGE_CACHE.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-07 02:16:23 -04:00
Roberto Rosario
d4e1a506ed Add duplicated document scan support.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-06 02:56:35 -04:00
Roberto Rosario
55eedc153e Convert document version checksum field from a text field to a char
field to be able to index across all db backends without problem.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-05 16:10:05 -04:00
Roberto Rosario
2ec939e595 Index the document checksum field for faster searches by checksum.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-05 15:44:16 -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
6a9c66ff3f Return False for the document's exists() method when it doesn't have
a document version.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-06-30 17:47:01 -04:00
Roberto Rosario
eb29cd502c Fix typos.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-06-21 02:26:33 -04:00
Roberto Rosario
4150fea2ad Add PDF orientation detection. Closes GitLab issue #387.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-06-16 22:30:07 -04:00
Roberto Rosario
fede3ec0ba Return an empty DocumentPage Queryset when a document has no latest version.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-05-28 01:06:33 -04:00
Roberto Rosario
7a0c2224bb Add model docstrings.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-04-25 14:21:30 -04:00
Roberto Rosario
86a602aa34 PEP8 cleanups. 2016-12-31 02:25:02 -04:00
Roberto Rosario
4f889fc21d Move the document language choice list from the model to the form.
Pycoutry upgrades or user changes to the language choice list won't
trigger a migration anymore. Closes GitLab issue #328.
2016-12-31 02:20:56 -04:00
Roberto Rosario
1e194e04fa Move new version creation blocking from the documents app to the checkouts app.
Closes GitLab #294.
2016-12-22 01:45:43 -04:00
Roberto Rosario
bc7f5f44ed Improve document page image lazy loading. Use font awesome spinner and CSS3 animation. 2016-11-04 03:33:24 -04:00
Roberto Rosario
3df30b63f3 Make sure the method has sensible defaults. 2016-11-04 01:34:12 -04:00
Roberto Rosario
2cdee10d50 Make sure transformation arguments are always valid. 2016-11-03 15:34:32 -04:00
Roberto Rosario
621c988809 Simplify filter_by_access boilerplate code 2016-11-02 03:48:16 -04:00
Roberto Rosario
c0194c63dc Refactor document page image generation and transformation classes
to cache all transformed versions of a document page.
2016-11-02 02:34:57 -04:00
Roberto Rosario
6e3d99670c Complete conversion of download views to CBV views using django-downloadview.
This also removes dependency on the filetransfers library.
2016-10-31 01:00:35 -04:00
Roberto Rosario
b8b2e0e929 Initial commit to support per page search. 2016-10-27 02:48:40 -04:00
Roberto Rosario
8d549df088 Index the is_stub and is_deleted document boolean fields. 2016-05-09 19:54:32 -04:00
Roberto Rosario
23f40ac4aa PEP8 cleanups. 2016-04-27 20:31:02 -04:00
Roberto Rosario
c6890c487a Extract a file like object's file name as per docs (using the .name property) and not an unicode representation of the file object instance. Reference: https://docs.python.org/2.7/library/stdtypes.html#file-objects 2016-03-30 01:32:53 -04:00
Roberto Rosario
5de63c4477 Add support for verifying and unverifying signatures after a key is added or deleted. 2016-03-26 04:23:16 -04:00
Roberto Rosario
ffb29e0f54 Remove obsolete Document property. Use resolved_object in documents links to avoid context variable clashes with signatures. 2016-03-25 04:12:44 -04:00