paperap.models.profile.queryset module


METADATA:

File: queryset.py

Project: paperap

Created: 2025-03-04

Version: 0.0.5

Author: Jess Mann Email: jess@jmann.me

Copyright (c) 2025 Jess Mann


LAST MODIFIED:

2025-03-04 By Jess Mann

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

Bases: StandardQuerySet[Profile]

A lazy-loaded, chainable query interface for Profile resources in Paperless NGX.

Provides pagination, filtering, and caching functionality similar to Django’s BaseQuerySet. Designed to be lazy - only fetching data when it’s actually needed.

Examples

>>> profiles = ProfileQuerySet()
>>> profiles = profiles.email("example@example.com")
>>> for profile in profiles:
>>>     print(profile.first_name)
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)

email(value, *, exact=True, case_insensitive=True)[source]

Filter by email.

Parameters:
  • value (str) – The email to filter by.

  • exact (bool) – Whether to filter by an exact match.

  • case_insensitive (bool) – Whether the match should be case insensitive.

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the filter applied.

Examples

>>> profiles = ProfileQuerySet()
>>> profiles = profiles.email("example@example.com")

Examples

>>> profiles = client.profiles().email("john.doe@gmail.com")
>>> profiles = client.profiles().email("gmail.com", exact=False)
>>> profiles = client.profiles().email("jOhN.DOE@gmail.com", case_insensitive=True)
first_name(value, *, exact=True, case_insensitive=True)[source]

Filter by first name.

Parameters:
  • first_name – The first name to filter by.

  • exact (bool) – Whether to filter by an exact match.

  • case_insensitive (bool) – Whether the match should be case insensitive.

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the filter applied.

Examples

>>> profiles = client.profiles().first_name("John")
>>> profiles = client.profiles().first_name("John", exact=False)
>>> profiles = client.profiles().first_name("JOHN", case_insensitive=False)
Parameters:

value (str)

last_name(value, *, exact=True, case_insensitive=True)[source]

Filter by last name.

Parameters:
  • last_name – The last name to filter by.

  • exact (bool) – Whether to filter by an exact match.

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the filter applied.

Examples

>>> profiles = client.profiles().last_name("Doe")
>>> profiles = client.profiles().last_name("Doe", exact=False)
>>> profiles = client.profiles().last_name("DOE", case_insensitive=False)
Parameters:
  • value (str)

  • case_insensitive (bool)

has_usable_password(value=True)[source]

Filter by has usable password.

Parameters:

has_usable_password – The has usable password to filter by.

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the filter applied.

Examples

>>> profiles = client.profiles().has_usable_password()
>>> profiles = client.profiles().has_usable_password(False)
Parameters:

value (bool)