优化示例
This commit is contained in:
parent
58314c5ee9
commit
9e989e3421
@ -122,7 +122,7 @@ class AccountWechats(Base):
|
||||
auth_refresh_token = Column(String(255), nullable=False)
|
||||
|
||||
class Config:
|
||||
orm_mode = True # 允许与Pydantic的ORM功能兼容,直接读取数据库模型对象
|
||||
from_attributes = True # 允许与Pydantic的ORM功能兼容,直接读取数据库模型对象
|
||||
```
|
||||
|
||||
### 2.创建schema:
|
||||
@ -186,7 +186,7 @@ class AccountWechats(AccountWechatsBase):
|
||||
acid: int # 表中的主键ID
|
||||
|
||||
class Config:
|
||||
orm_mode = True # 允许与ORM对象进行直接转换
|
||||
from_attributes = True # 允许与ORM对象进行直接转换
|
||||
```
|
||||
|
||||
### 3.创建 CRUD (可选,不知道创建什么逻辑可以先跳过):
|
||||
|
Loading…
Reference in New Issue
Block a user