Можем ли мы объявить модель, наследующую базовую модель, и поместить в нее значение, а не обычную модель Python?
Я могу принудительно создать модель PyTimeZoneSetting, но могу ли я использовать существующую TimeZoneSetting?
from pydantic import BaseModel
from typing import List, Optional
class TimeZoneSetting(BaseModel):
time_zone: str
type: int
sync_time: Optional[str] = None
time_server: Optional[str] = None
time_set_type: Optional[int] = None
class PyTimeZoneSetting():
time_zone: str
type: int
sync_time: str
time_server: str
time_set_type: str
def update_system_timezone():
!Here, I want to create a TimeZoneSetting model and put in a value.!