41 lines
No EOL
882 B
Python
41 lines
No EOL
882 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any, Dict, List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class UsersObjItem(BaseModel):
|
|
pk: int
|
|
username: str
|
|
name: str
|
|
is_active: bool
|
|
last_login: str
|
|
email: str
|
|
avatar: str
|
|
attributes: Dict[str, Any]
|
|
uid: str
|
|
|
|
class GroupsObjItem(BaseModel):
|
|
pk: str
|
|
name: str
|
|
is_superuser: bool
|
|
parent: str
|
|
parent_name: str
|
|
users: List[int]
|
|
attributes: Dict[str, Any]
|
|
users_obj: List[UsersObjItem]
|
|
|
|
class User(BaseModel):
|
|
pk: Optional[str]
|
|
username: str
|
|
name: str
|
|
is_active: bool = None
|
|
last_login: Optional[str] = None
|
|
is_superuser: Optional[bool] = None
|
|
groups: List[str]
|
|
groups_obj: Optional[List[GroupsObjItem]] = None
|
|
email: str
|
|
avatar: Optional[str] = None
|
|
attributes: Dict[str, Any] = None
|
|
uid: Optional[str] = None |