Models
- class document_catalogue.models.Document(*args, **kwargs)[source]
A file and the meta-data describing that file in the catalogue.
- exception DoesNotExist
- exception MultipleObjectsReturned
- class PrivateFileField(*args, **kwargs)
Filefield with private storage, custom filename and size checks.
Extra settings: -
upload_subfolder: a lambda to find the subfolder, depending on the instance. -content_types: list of allowed content types. -max_file_size: maximum file size.- clean(*args, **kwargs)
Convert the value’s type and run validation. Validation errors from to_python() and validate() are propagated. Return the correct value if no error is raised.
- generate_filename(instance, filename)
Apply (if callable) or prepend (if a string) upload_to to the filename, then delegate further processing of the name to the storage backend. Until the storage layer, all file paths are expected to be Unix style (with forward slashes).
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- class document_catalogue.models.DocumentCategory(*args, **kwargs)[source]
A hierarchical category system for assets
- exception DoesNotExist
- exception MultipleObjectsReturned
- class document_catalogue.models.DocumentManager(*args, **kwargs)[source]
Manager for Document model with all methods from DocumentQuerySet.
- class document_catalogue.models.DocumentQueryset(model=None, query=None, using=None, hints=None)[source]
Custom query set for Document model