Skip to content

Commit

Permalink
swap order of Page and Mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahframe committed Jun 12, 2024
1 parent 60d7a03 commit e9603b8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
22 changes: 1 addition & 21 deletions cdhweb/blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/blog/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/pages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9603b8

Please sign in to comment.