From e9603b8359856c65a645ec1e73e97f0995bd9b6b Mon Sep 17 00:00:00 2001 From: sarahframe Date: Wed, 12 Jun 2024 13:26:53 +1200 Subject: [PATCH] swap order of Page and Mixin --- cdhweb/blog/models.py | 22 +--------------------- cdhweb/blog/tests/conftest.py | 2 +- cdhweb/events/models.py | 2 +- cdhweb/pages/models.py | 2 +- cdhweb/projects/models.py | 2 +- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/cdhweb/blog/models.py b/cdhweb/blog/models.py index 4143c17a..6e51f80d 100644 --- a/cdhweb/blog/models.py +++ b/cdhweb/blog/models.py @@ -174,16 +174,6 @@ class BlogPost(BasePage, ClusterableModel): # custom manager/queryset logic objects = BlogPostManager() - # @property - # def short_title(self): - # """Shorter title with ellipsis.""" - # return Truncator(self.title).chars(65) - - # @property - # def short_description(self): - # """Shorter description with ellipsis.""" - # return Truncator(self.get_description()).chars(250) - @cached_property def breadcrumbs(self): ancestors = self.get_ancestors().live().public().specific() @@ -194,16 +184,6 @@ def author_list(self): """Comma-separated list of author names.""" return ", ".join(str(author.person) for author in self.authors.all()) - # def __str__(self): - # # string is used for logging actions on drafts, - # # needs to handle cases where first published date is not set - # if self.first_published_at: - # pubdate = format(self.first_published_at, "F j, Y") - # else: - # pubdate = "draft" - - # return '"%s" (%s)' % (self.short_title, pubdate) - def get_url_parts(self, *args, **kwargs): """Custom blog post URLs of the form /updates/2014/03/01/my-post.""" url_parts = super().get_url_parts(*args, **kwargs) @@ -245,7 +225,7 @@ class BlogLinkPageArchived(LinkPage): subpage_types = [BlogPost] -class BlogLandingPage(Page, StandardHeroMixinNoImage): +class BlogLandingPage(StandardHeroMixinNoImage, Page): """Container page that defines where Event pages can be created.""" content_panels = StandardHeroMixinNoImage.content_panels diff --git a/cdhweb/blog/tests/conftest.py b/cdhweb/blog/tests/conftest.py index 9f83533d..c592dfba 100644 --- a/cdhweb/blog/tests/conftest.py +++ b/cdhweb/blog/tests/conftest.py @@ -4,7 +4,7 @@ import pytest from django.utils import timezone -from cdhweb.blog.models import Author, BlogLinkPageArchivedArchived, BlogPost +from cdhweb.blog.models import Author, BlogLinkPageArchived, BlogPost from cdhweb.pages.tests.conftest import to_streamfield_safe EST = zoneinfo.ZoneInfo("America/New_York") diff --git a/cdhweb/events/models.py b/cdhweb/events/models.py index 60d55ba5..03fc9520 100644 --- a/cdhweb/events/models.py +++ b/cdhweb/events/models.py @@ -403,7 +403,7 @@ class EventsLinkPageArchived(LinkPage): subpage_types = [Event, LinkPage, ContentPage] -class EventsLandingPage(Page, StandardHeroMixinNoImage): +class EventsLandingPage(StandardHeroMixinNoImage, Page): """Container page that defines where Event pages can be created.""" content_panels = StandardHeroMixinNoImage.content_panels diff --git a/cdhweb/pages/models.py b/cdhweb/pages/models.py index 22588d05..182104bf 100644 --- a/cdhweb/pages/models.py +++ b/cdhweb/pages/models.py @@ -364,7 +364,7 @@ class Meta: verbose_name = "Section Landing Page" -class HomePage(Page, HomePageHeroMixin): +class HomePage(HomePageHeroMixin, Page): """A home page that aggregates and displays featured content.""" body = StreamField( diff --git a/cdhweb/projects/models.py b/cdhweb/projects/models.py index fe31aeae..a11aec14 100644 --- a/cdhweb/projects/models.py +++ b/cdhweb/projects/models.py @@ -344,7 +344,7 @@ class ProjectsLandingPageArchived(LandingPage): template = LandingPage.template -class ProjectsLandingPage(Page, StandardHeroMixin): +class ProjectsLandingPage(StandardHeroMixin, Page): content_panels = StandardHeroMixin.content_panels search_fields = StandardHeroMixin.search_fields