Skip to content

Add __str__ to remaining studies models - #1575

Merged
danlamanna merged 1 commit into
masterfrom
studies/model-str
Aug 7, 2026
Merged

Add __str__ to remaining studies models#1575
danlamanna merged 1 commit into
masterfrom
studies/model-str

Conversation

@danlamanna

@danlamanna danlamanna commented Aug 7, 2026

Copy link
Copy Markdown
Member

Annotation, StudyTask, Response, and Markup all rendered as " object (pk)" in the admin, including in list_display columns and inlines. Every other model in the app already defines str.

Markup's list_display renders the annotation, so select_related the relations that Annotation.str now traverses.

Summary by CodeRabbit

  • Improvements
    • Enhanced administrative views for markup records by loading related study, image, annotation, and annotator details more efficiently.
    • Added clearer labels for annotations, markups, responses, and study tasks, making records easier to identify and interpret.
    • Markups now indicate whether each feature is present or absent, while responses display the associated question and selected value.

Annotation, StudyTask, Response, and Markup all rendered as
"<Model> object (pk)" in the admin, including in list_display columns and
inlines. Every other model in the app already defines __str__.

Markup's list_display renders the annotation, so select_related the
relations that Annotation.__str__ now traverses.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd76fc8a-b400-41fd-8975-63857a1c4760

📥 Commits

Reviewing files that changed from the base of the PR and between 2bc48f2 and b38371b.

📒 Files selected for processing (5)
  • isic/studies/admin.py
  • isic/studies/models/annotation.py
  • isic/studies/models/markup.py
  • isic/studies/models/response.py
  • isic/studies/models/study_task.py

📝 Walkthrough

Walkthrough

The PR adds formatted string representations to four study models and updates MarkupAdmin to eager-load related feature and annotation objects in its queryset.

Changes

Study administration and model display

Layer / File(s) Summary
Model string representations
isic/studies/models/annotation.py, isic/studies/models/markup.py, isic/studies/models/response.py, isic/studies/models/study_task.py
Annotation, Markup, Response, and StudyTask now provide formatted string values based on their related data.
Markup admin queryset
isic/studies/admin.py
MarkupAdmin.get_queryset preserves the base queryset and eager-loads the markup feature and annotation relationships.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: brianhelba

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding str methods to the remaining studies models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch studies/model-str

Comment @coderabbitai help to get the list of available commands.

@danlamanna
danlamanna merged commit 2f83b38 into master Aug 7, 2026
2 checks passed
@danlamanna
danlamanna deleted the studies/model-str branch August 7, 2026 19:19
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