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

1""" 

2---------------------------------------------------------------------------- 

3 

4 METADATA: 

5 

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 

13 

14---------------------------------------------------------------------------- 

15 

16 LAST MODIFIED: 

17 

18 2025-03-04 By Jess Mann 

19 

20""" 

21 

22from __future__ import annotations 

23 

24from typing import Any 

25 

26from pydantic import Field 

27 

28from paperap.models.abstract.model import StandardModel 

29from paperap.models.profile.queryset import ProfileQuerySet 

30 

31 

32class Profile(StandardModel): 

33 """ 

34 Represents a user profile in the Paperless NGX system. 

35 

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. 

44 

45 Examples: 

46 >>> profile = Profile(email="a@google.com", password="abc", first_name="John", last_name="Doe") 

47 >>> print(profile.email) 

48 

49 """ 

50 

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 

58 

59 class Meta(StandardModel.Meta): 

60 queryset = ProfileQuerySet