paperap.models.document.download.model module


METADATA:

File: download.py

Project: paperap

Created: 2025-03-18

Version: 0.0.9

Author: Jess Mann Email: jess@jmann.me

Copyright (c) 2025 Jess Mann


LAST MODIFIED:

2025-03-18 By Jess Mann

class paperap.models.document.download.model.RetrieveFileMode(*values)[source]

Bases: str, Enum

Enum for document file retrieval modes.

DOWNLOAD = 'download'
PREVIEW = 'preview'
THUMBNAIL = 'thumbnail'
class paperap.models.document.download.model.DownloadedDocument(**data)[source]

Bases: StandardModel

Represents a downloaded Paperless-NgX document file.

mode

The retrieval mode (download, preview, thumbnail).

original

Whether to retrieve the original file.

content

The binary content of the file.

content_type

The MIME type of the file.

disposition_filename

The filename from the Content-Disposition header.

disposition_type

The type from the Content-Disposition header.

Parameters:

data (Any)

mode: RetrieveFileMode | None
original: bool
content: bytes | None
content_type: str | None
disposition_filename: str | None
disposition_type: str | None
class Meta(model)[source]

Bases: Meta

Parameters:

model (type[_Self])

read_only_fields: ClassVar[set[str]] = {'content', 'content_type', 'disposition_filename', 'disposition_type', 'id'}
blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'content', 'content_type', 'disposition_filename', 'disposition_type', 'id', 'mode', 'original'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model: type[_Self]
name: str
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
Return type:

None

id: int