paperap.models.document.download.queryset module

Module for handling document download operations through querysets.

This module provides the queryset implementation for downloaded documents, enabling efficient querying and manipulation of document download operations in Paperless-NgX.

class paperap.models.document.download.queryset.DownloadedDocumentQuerySet(resource, filters=None, _cache=None, _fetch_all=False, _next_url=None, _last_response=None, _iter=None, _urls_fetched=None)[source]

Bases: StandardQuerySet[DownloadedDocument]

A specialized queryset for handling downloaded document operations.

This queryset extends StandardQuerySet to provide functionality specific to downloaded documents from Paperless-NgX. It enables efficient querying, filtering, and manipulation of document download operations.

The queryset is lazy-loaded, meaning API requests are only made when data is actually needed, improving performance when working with large document collections.

Examples

>>> # Download original documents
>>> client.documents.filter(title__contains="invoice").download("invoices/")
>>>
>>> # Download archive versions
>>> client.documents.filter(archived=True).download(
...     "archives/", archive_version=True
... )
Parameters:
  • resource (BaseResource[_Model, Self])

  • filters (dict[str, Any] | None)

  • _cache (list[_Model] | None)

  • _fetch_all (bool)

  • _next_url (str | None)

  • _last_response (ClientResponse)

  • _iter (Iterator[_Model] | None)

  • _urls_fetched (list[str] | None)