paperap.models.profile.queryset module

Provide query interface for Profile resources in Paperless-NGX.

This module contains the ProfileQuerySet class which extends StandardQuerySet to provide profile-specific filtering methods for efficient querying of user profiles in the Paperless-NGX system.

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]

Implement a lazy-loaded, chainable query interface for Profile resources.

Extends StandardQuerySet to provide profile-specific filtering methods, allowing for efficient querying of user profiles in the Paperless-NGX system. Following the lazy-loading pattern, data is only fetched when actually needed.

Inherits all attributes from StandardQuerySet.

Examples

Get all profiles:
>>> profiles = client.profiles()
Filter profiles by email:
>>> profiles = client.profiles().email("example@example.com")
Iterate through results:
>>> 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 profiles by email address.

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

  • exact (bool) – Whether to filter by an exact match (True) or partial match (False). Defaults to True.

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

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the email filter applied.

Examples

Exact match (default):
>>> profiles = client.profiles().email("john.doe@gmail.com")
Partial match (contains):
>>> profiles = client.profiles().email("gmail.com", exact=False)
Case-sensitive match:
>>> profiles = client.profiles().email("John.Doe@gmail.com", case_insensitive=False)
first_name(value, *, exact=True, case_insensitive=True)[source]

Filter profiles by first name.

Parameters:
  • value (str) – The first name or pattern to filter by.

  • exact (bool) – Whether to filter by an exact match (True) or partial match (False). Defaults to True.

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

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the first name filter applied.

Examples

Exact match (default):
>>> profiles = client.profiles().first_name("John")
Partial match (contains):
>>> profiles = client.profiles().first_name("Jo", exact=False)
Case-sensitive match:
>>> profiles = client.profiles().first_name("John", case_insensitive=False)
last_name(value, *, exact=True, case_insensitive=True)[source]

Filter profiles by last name.

Parameters:
  • value (str) – The last name or pattern to filter by.

  • exact (bool) – Whether to filter by an exact match (True) or partial match (False). Defaults to True.

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

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the last name filter applied.

Examples

Exact match (default):
>>> profiles = client.profiles().last_name("Doe")
Partial match (contains):
>>> profiles = client.profiles().last_name("Do", exact=False)
Case-sensitive match:
>>> profiles = client.profiles().last_name("Doe", case_insensitive=False)
has_usable_password(value=True)[source]

Filter profiles by whether they have a usable password.

Distinguish between local user accounts and those authenticated through external systems (like OAuth or LDAP) based on password usability.

Parameters:

value (bool) – True to find profiles with usable passwords, False to find profiles without usable passwords. Defaults to True.

Return type:

ProfileQuerySet

Returns:

A new ProfileQuerySet instance with the password usability filter applied.

Examples

Find profiles with usable passwords (local accounts):
>>> profiles = client.profiles().has_usable_password()
Find profiles without usable passwords (external auth):
>>> profiles = client.profiles().has_usable_password(False)