From f872eee36725c1e6cc45f78e4c7f0787bbd8f4c6 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Wed, 4 Nov 2026 03:54:53 +0800 Subject: [PATCH] =?UTF-8?q?docs(model):=20Period.kind=20=E7=8E=B0=E7=8A=B6?= =?UTF-8?q?=E6=BE=84=E6=B8=85=E2=80=94=E2=80=94=E6=81=92=E4=B8=BA=20week?= =?UTF-8?q?=20=E7=9A=84=E7=95=99=E9=97=A8=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E6=9C=88=E7=B2=92=E5=BA=A6=E7=94=B1=20year/month=20=E5=90=88?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 排查结论(第 6 轮遗留决策):kind 全链无读取方(后端不按其过滤,顶栏月粒度用 year/month 列, 前端 weekly 行的 kind 是另一条「行类型」线,与此无关);但删它要动写入+to_dict+历史库兼容, 收益小于风险——裁决保留列、堵注释与文档的歧义(README 原「年/月/周」误导)。 --- README.md | 2 +- app/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47043ef..f6c2b4d 100644 --- a/README.md +++ b/README.md @@ -488,7 +488,7 @@ python scripts/legacy/add_entry_date.py --force # 全部重算 ``` # 项目管理(长期重点项目) -Period(周期: 年/月/周, sort_key) +Period(周期: 一行=一个自然周, kind 恒为 week——月粒度由 year/month 列合成, sort_key 全排序) └── Project(分类, 负责人 owners[0], 其他负责人, 团队成员, 状态, 重点标记, 进度, 标签) ├── Task(子任务) └── Update(执行情况: 正文, 摘要, 进度, 状态, 风险, 下一步, 来源, 原文) diff --git a/app/models.py b/app/models.py index 8e5e3ec..8740162 100644 --- a/app/models.py +++ b/app/models.py @@ -192,7 +192,7 @@ class Period(Base): id: Mapped[int] = mapped_column(Integer, primary_key=True) label: Mapped[str] = mapped_column(String(64), nullable=False) # 8月第4周 - kind: Mapped[str] = mapped_column(String(16), default="week", nullable=False) # week|month + kind: Mapped[str] = mapped_column(String(16), default="week", nullable=False) # 恒为 week:月粒度由 year/month 合成,此列只是留门(无任何读取方) year: Mapped[int] = mapped_column(Integer, nullable=False) month: Mapped[int] = mapped_column(Integer, nullable=False) week: Mapped[int] = mapped_column(Integer, default=0, nullable=False) # 月视图为 0