Coverage for src/paperap/models/profile/model.py: 100%
15 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 23:40 -0400
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 23:40 -0400
1"""
2----------------------------------------------------------------------------
4 METADATA:
6 File: profile.py
7 Project: paperap
8 Created: 2025-03-04
9 Version: 0.0.5
10 Author: Jess Mann
11 Email: jess@jmann.me
12 Copyright (c) 2025 Jess Mann
14----------------------------------------------------------------------------
16 LAST MODIFIED:
18 2025-03-04 By Jess Mann
20"""
22from __future__ import annotations
24from typing import Any
26from pydantic import Field
28from paperap.models.abstract.model import StandardModel
29from paperap.models.profile.queryset import ProfileQuerySet
32class Profile(StandardModel):
33 """
34 Represents a user profile in the Paperless NGX system.
36 Attributes:
37 email: The email address of the user.
38 password: The password for the user.
39 first_name: The first name of the user.
40 last_name: The last name of the user.
41 auth_token: The authentication token for the user.
42 social_accounts: A list of social accounts associated with the user.
43 has_usable_password: Indicates if the user has a usable password.
45 Examples:
46 >>> profile = Profile(email="a@google.com", password="abc", first_name="John", last_name="Doe")
47 >>> print(profile.email)
49 """
51 email: str | None = None
52 password: str | None = None
53 first_name: str | None = None
54 last_name: str | None = None
55 auth_token: str | None = None
56 social_accounts: list[Any] = Field(default_factory=list) # TODO unknown subtype
57 has_usable_password: bool
59 class Meta(StandardModel.Meta):
60 queryset = ProfileQuerySet