问题描述
我们可以声明一个继承 basemodel 并在其中放置值的模型,而不是普通的 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.!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)