File size: 495 Bytes
6f179e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pydantic import BaseModel

UUID = str


class Role(BaseModel):
    role_name: str
    role_nickname: str = None
    model_role_name: str
    model_role_nickname: str = None


class User:
    history: list[str] = []
    role_name: str = None
    role_nickname: str = None
    model_role_name: str = None
    model_role_nickname: str = None

    def update(self, new_properties: dict) -> "User":
        for k, v in new_properties.items():
            setattr(self, k, v)
        return self