Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Membership drops the TimeStamped ordering its siblings keep

未关闭 适合新手
#335 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
django, python
领域
backend, database

调研方向

从 accounts/models.py 第 83 行附近开始,将 Membership.Meta 与 abstract/models.py 第 31-34 行进行比较,然后检查 Membership queryset 的调用方是否存在关于排序的假设。完成的标准是 Membership 具有与其对应的 TimeStamped 模型相同的时间戳排序和 latest 行为,并且已检查受影响的调用方。

由索引模型根据 Issue 内容生成。

描述

bug side quest

Membership drops the ordering that every other TimeStamped model keeps. Membership.objects.latest() raises as a result.

Work reference: branch codingjoe-weekly-digest, commits 2ace45d2 to 6f28eacf, weekly sending digest (superJoe crew, out of scope for that change).

side quest: accounts.models.Membership.Meta does not inherit TimeStamped.Meta, so Membership silently drops the modified_at/created_at ordering and get_latest_by that every sibling model keeps. [accounts/models.py]:L83

abstract.models.TimeStamped.Meta sets ordering = ("-modified_at", "-created_at") and get_latest_by = "created_at" (abstract/models.py:31-34). Membership.Meta declares only the unique constraint. The model therefore has no default ordering, while every other TimeStamped child inherits one. Membership.objects.latest() raises.

The change is one line, but it alters the ordering of any unordered membership queryset. It needs a check of its callers, not a drive-by fix.

主要语言
Python
星标
4
派生
0
平均合并
2 小时 40 分钟
30 天内合并 PR
163

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codingjoe/relay 的其他 Issue

查看 codingjoe/relay 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。