From 55c1a0a8db9718c7f75e31bcf71adec80c25ed73 Mon Sep 17 00:00:00 2001 From: cruldra Date: Mon, 31 Mar 2025 15:58:59 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Python/Web/.cursorrules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python/Web/.cursorrules | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Python/Web/.cursorrules b/Python/Web/.cursorrules index e9fe44f..23df9de 100644 --- a/Python/Web/.cursorrules +++ b/Python/Web/.cursorrules @@ -50,7 +50,17 @@ description: Python Web开发最佳实践与规范 ## 数据库 - 使用`sqlmodel`作为数据库ORM框架 +- 所有涉及数据库操作的代码都位于`$PROJECT_ROOT/app/db/crud`目录下,结构如下: + ```markdown + db + ├── crud # 数据库操作 + │ ├── __init__.py + │ ├── base.py # 基础操作 + │ ├── model_name1.py # 实体1操作 + │ ├── model_name2.py # 实体2操作 + │ └── ... + ``` ## 示例 @@ -79,3 +89,7 @@ description: Python Web开发最佳实践与规范 - 使用[wrapt](https://wrapt.readthedocs.io/en/latest/)库创建装饰器 - 装饰器应位于`$PROJECT_ROOT/app/$MODULE_NAME/utils.py`文件中 + +## 函数返回值 + +- 函数返回值应使用`returns`库