Conversation
Extract shared visibility filtering and stat annotations into a ReadingListQuerySet, add mixins for the slug-lookup/permission-check boilerplate repeated across several views, and factor out the issue-range filtering and reorder logic duplicated between AddIssuesFromSeriesView and AddIssuesFromArcView.
Move the issue-type/series/publisher breakdown and featured creators/characters computation into a standalone build_reading_list_breakdown_context() function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReadingListQuerySet(visible_to()/with_list_stats()), replacing four near-identical copies acrossReadingListListView,SearchReadingListListView,UserReadingListListView,ReadingListDetailView, andReadingListItemsLoadMore.ReadingListFromSlugMixin/ManageReadingListMixinto remove duplicated slug-lookupdispatch(),test_func(),get_success_url(), and context-injection boilerplate fromAssignReadingListToMetronView,RemoveIssueFromReadingListView,AddIssueWithAutocompleteView,AddIssuesFromSeriesView, andAddIssuesFromArcView.filter_issues_by_number_range()andadd_issues_to_reading_list()helpers, deduplicating the issue-range filtering and beginning/end reorder logic shared byAddIssuesFromSeriesViewandAddIssuesFromArcView(and dropping theirnoqa: PLR0912, PLR0915complexity suppressions).ReadingListDetailView.get_context_data()into a standalonebuild_reading_list_breakdown_context()function.reading_lists/TECHNICAL.mdto document the new queryset methods, mixins, and helper functions.No behavior changes — this is a pure internal refactor for maintainability.