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 | |