Remove subtitle from listing pages
This commit is contained in:
parent
e6ee7d475a
commit
27bce00c46
5 changed files with 70 additions and 3 deletions
|
@ -1,9 +1,9 @@
|
|||
from website.common.factories import BaseContentFactory
|
||||
from website.common.factories import BaseContentFactory, BaseListingFactory
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
class BlogPostListPageFactory(BaseContentFactory):
|
||||
class BlogPostListPageFactory(BaseListingFactory):
|
||||
class Meta:
|
||||
model = models.BlogPostListPage
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 4.0.6 on 2022-08-27 18:16
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("blog", "0020_alter_blogpostcollectionlistpage_body_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="blogpostcollectionlistpage",
|
||||
name="subtitle",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="blogpostcollectionpage",
|
||||
name="subtitle",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="blogpostlistpage",
|
||||
name="subtitle",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="blogposttaglistpage",
|
||||
name="subtitle",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="blogposttagpage",
|
||||
name="subtitle",
|
||||
),
|
||||
]
|
|
@ -9,11 +9,15 @@ class BaseContentFactory(wagtail_factories.PageFactory):
|
|||
subtitle = factory.Faker("bs")
|
||||
|
||||
|
||||
class BaseListingFactory(wagtail_factories.PageFactory):
|
||||
title = factory.Faker("catch_phrase")
|
||||
|
||||
|
||||
class ContentPageFactory(BaseContentFactory):
|
||||
class Meta:
|
||||
model = models.ContentPage
|
||||
|
||||
|
||||
class ListingPageFactory(BaseContentFactory):
|
||||
class ListingPageFactory(BaseListingFactory):
|
||||
class Meta:
|
||||
model = models.ListingPage
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 4.0.6 on 2022-08-27 18:16
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("common", "0019_alter_contentpage_body_alter_listingpage_body"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="listingpage",
|
||||
name="subtitle",
|
||||
),
|
||||
]
|
|
@ -178,6 +178,19 @@ class ContentPage(BaseContentPage):
|
|||
|
||||
class BaseListingPage(RoutablePageMixin, BaseContentPage):
|
||||
PAGE_SIZE = 20
|
||||
subtitle = None
|
||||
|
||||
content_panels = [
|
||||
panel
|
||||
for panel in BaseContentPage.content_panels
|
||||
if panel.field_name != "subtitle"
|
||||
]
|
||||
|
||||
search_fields = [
|
||||
panel
|
||||
for panel in BaseContentPage.search_fields
|
||||
if panel.field_name != "subtitle"
|
||||
]
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
Loading…
Reference in a new issue