paperap.models.profile.model module
User profile module for Paperless-NGX.
This module defines the Profile model which represents user profiles in the Paperless-NGX system, including personal information and authentication details.
- class paperap.models.profile.model.Profile(**data)[source]
Bases:
StandardModel
Represents a user profile in the Paperless-NGX system.
This model corresponds to the user profile endpoint in the Paperless-NGX API and contains information about users, including their personal details and authentication information.
- password
The password for the user. This is write-only and will not be returned in API responses.
- Type:
str
, optional
- auth_token
The authentication token for the user. This can be used for API authentication.
- Type:
str
, optional
- social_accounts
A list of social accounts associated with the user for third-party authentication.
- Type:
- has_usable_password
Indicates if the user has a usable password. False if the user can only log in via social authentication or tokens.
- Type:
Examples
>>> # Create a new profile >>> profile = Profile( ... email="user@example.com", ... first_name="John", ... last_name="Doe", ... has_usable_password=True ... ) >>> >>> # Access profile information >>> print(f"{profile.first_name} {profile.last_name} <{profile.email}>") John Doe <user@example.com>
- Parameters:
data (
Any
)
- email: str | None
- password: str | None
- first_name: str | None
- last_name: str | None
- auth_token: str | None
- social_accounts: list[Any]
- has_usable_password: bool
- class Meta(model)[source]
Bases:
Meta
Metadata for the Profile model.
This class defines metadata for the Profile model, including the associated queryset class for performing queries on profiles.
- queryset
The queryset class to use for profile queries.
- Type:
type[ProfileQuerySet]
- Parameters:
model (type[_Self])
- queryset
alias of
ProfileQuerySet
- blacklist_filtering_params: ClassVar[set[str]] = {}
- field_map: dict[str, str] = {}
- filtering_disabled: ClassVar[set[str]] = {}
- filtering_fields: ClassVar[set[str]] = {'_resource', 'auth_token', 'email', 'first_name', 'has_usable_password', 'id', 'last_name', 'password', 'social_accounts'}
- read_only_fields: ClassVar[set[str]] = {'id'}
- 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.
- id: int