Skip to content

DRU-663 -- Name subjects with __str__ and let a model declare its order - #738

Merged
czpython merged 1 commit into
mainfrom
commonzenpython/dru-663-name-subjects-with-__str__-and-let-a-model-declare-its-order
Sep 27, 2026
Merged

czpython merged 1 commit into
mainfrom
commonzenpython/dru-663-name-subjects-with-__str__-and-let-a-model-declare-its-order

Conversation

@czpython

@czpython czpython commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

A subject's __str__ is its name on runs, events, the Activity feed, and its board, replacing get_key(). The default stays its type and id, such as note 7.

class Decision(StoredSubject, ordering=("-created_at",)):
    title: Mapped[str]
    outcome: Mapped[DecisionAction]   # a Literal, stored under a CHECK

    def __str__(self) -> str:
        return self.title
  • The subject title goes from runs, events, the feed and its search, and SubjectSummary, and summary_class goes with it. The platform builds its header from the id and the name; an app with its own frontend overrides get_summary().
  • A model declares its order on the class line in Django's form, and filter and the default board follow it.
  • A Literal column is stored under a CHECK of its values, like a StrEnum.
  • An identity-only Subject answers get(id), which raises ObjectNotFound like Model.get.
  • A page for a missing subject links back to its parent page, or to the app's landing page.
  • Gate.answer and Workflow.cancel read their run through Run.get_latest_for_subject, which can narrow to the gate a run is parked on.
  • Software Factory builds a pull request subject with PullRequest(id=...), and a work item names itself with its ticket key and title.

@mintlify

mintlify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
druks 🟢 Ready View Preview Sep 27, 2026, 4:43 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

A subject's __str__ is its name on runs, events, the Activity feed, and its
board, replacing get_key(); the default stays its type and id. The subject
title goes from runs, events, the feed and its search, and SubjectSummary,
and summary_class goes with it: the platform builds its header from the id
and the name, and an app with its own frontend overrides get_summary().

A model declares its order on the class line in Django's form,
class Report(Model, ordering=("-created_at",)), and filter and the default
board follow it. A Literal column is stored under a CHECK of its values, like
a StrEnum. An identity-only Subject answers get(id), which raises
ObjectNotFound like Model.get, and a page for a missing subject links back to
its parent page or the app's landing page.

Gate.answer and Workflow.cancel read their run through
Run.get_latest_for_subject, which can narrow to the gate a run is parked on.

Software Factory builds a pull request subject with PullRequest(id=...), and a
work item names itself with its ticket key and title.
@czpython
czpython force-pushed the commonzenpython/dru-663-name-subjects-with-__str__-and-let-a-model-declare-its-order branch from 32a6824 to 8a10552 Compare September 27, 2026 16:43
@czpython
czpython merged commit b406f3f into main Sep 27, 2026
4 checks passed
@czpython
czpython deleted the commonzenpython/dru-663-name-subjects-with-__str__-and-let-a-model-declare-its-order branch September 27, 2026 16:48

This branch was successfully deployed

1 active deployment
staging - docs — 8a105523 Deployed Sep 27, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant