Skip to content

Comments

Reduce duplication in the view queryset code#377

Merged
spopelka-dsac merged 3 commits intomainfrom
sjp/refactor-views
Jan 30, 2026
Merged

Reduce duplication in the view queryset code#377
spopelka-dsac merged 3 commits intomainfrom
sjp/refactor-views

Conversation

@spopelka-dsac
Copy link
Contributor

@spopelka-dsac spopelka-dsac commented Jan 30, 2026

module-name: Reduce duplication in the view queryset code

Jira Ticket

Problem

We had our view querysets defined independently for our list() and retrieve() view methods, which made it harder to maintain the code, ensure consistency, and identify room for improvement from a performance standpoint.

Solution

This PR pulls all the queryset logic into a class attribute that is referenced by the list() and retrieve() methods, so the code for each view only needs to be maintained in one place. For clarity and consistency, this PR also moves the order by logic to the ordering class attribute.

These changes make it easier to understand and maintain the code, which in turn makes it easier to perform performance improvements and future code updates.

Test Plan

All tests should pass

@spopelka-dsac spopelka-dsac enabled auto-merge (squash) January 30, 2026 19:52
@spopelka-dsac spopelka-dsac merged commit c4ba8a9 into main Jan 30, 2026
11 checks passed
@wbprice wbprice deleted the sjp/refactor-views branch January 30, 2026 20:18
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.

2 participants