Skip to content

Commit

Permalink
Tweak choose view mixins names for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab committed Feb 13, 2025
1 parent fd7c23b commit 708da0f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cms/topics/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from wagtail.query import PageQuerySet


class FeaturedSeriesPageMixin:
class FeaturedSeriesPageChooseViewMixin:
model_class: ArticleSeriesPage

def get_object_list(self) -> "PageQuerySet[ArticleSeriesPage]":
Expand All @@ -36,10 +36,10 @@ def columns(self) -> list["Column"]:
]


class FeaturedSeriesPageChooseView(FeaturedSeriesPageMixin, ChooseView): ...
class FeaturedSeriesPageChooseView(FeaturedSeriesPageChooseViewMixin, ChooseView): ...


class FeaturedSeriesPageChooseResultsView(FeaturedSeriesPageMixin, ChooseResultsView): ...
class FeaturedSeriesPageChooseResultsView(FeaturedSeriesPageChooseViewMixin, ChooseResultsView): ...


class FeaturedSeriesPageChooserViewSet(ChooserViewSet):
Expand All @@ -52,8 +52,8 @@ class FeaturedSeriesPageChooserViewSet(ChooserViewSet):
edit_item_text = _("Edit Article Series page")


class HighlightedChildPageMixin:
def get_object_list(self) -> "PageQuerySet[StatisticalArticlePage | MethodologyPage]":
class HighlightedChildPageChooseViewMixin:
def get_object_list(self) -> "PageQuerySet[Page]":
model_class: StatisticalArticlePage | MethodologyPage = self.model_class # type: ignore[attr-defined]
pages: PageQuerySet[Page] = model_class.objects.all().defer_streamfields()
if topic_page_id := self.request.GET.get("topic_page_id"): # type: ignore[attr-defined]
Expand Down Expand Up @@ -90,10 +90,10 @@ def columns(self) -> list["Column"]:
]


class HighlightedPagePageChooseView(HighlightedChildPageMixin, ChooseView): ...
class HighlightedPagePageChooseView(HighlightedChildPageChooseViewMixin, ChooseView): ...


class HighlightedPagePageChooseResultsView(HighlightedChildPageMixin, ChooseResultsView): ...
class HighlightedPagePageChooseResultsView(HighlightedChildPageChooseViewMixin, ChooseResultsView): ...


class BaseHighlightedChildrenViewSet(ChooserViewSet):
Expand Down

0 comments on commit 708da0f

Please sign in to comment.