From 9e989e34215263979757865f88d5a1504e827b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3F=2E=2E=E6=BF=A1=2E=2E?= <2324281453@qq.com> Date: Fri, 3 Jan 2025 17:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78760cc..1b6072a 100644 --- a/README.md +++ b/README.md @@ -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 (可选,不知道创建什么逻辑可以先跳过):