Skip to content
Snippets Groups Projects
Commit cd778f8a authored by jan.bednarik's avatar jan.bednarik
Browse files

shared: Rename SubpageMixin

parent 12786a71
Branches
No related tags found
2 merge requests!173Release,!134Weby pro MS
......@@ -7,16 +7,7 @@ from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtailmetadata.models import MetadataPageMixin
from shared.models import Article, PeoplePage, SharedSubpageMixin
class SubpageMixin:
"""Must be used in class definition before MetadataPageMixin!
Obsolete, misto nej pouzivat SharedSubpageMixin
TODO je pouze v migracich, po odstraneni z nich lze smazat
"""
pass
from shared.models import Article, PeoplePage, SubpageMixin
class DistrictHomePage(MetadataPageMixin, Page):
......@@ -150,7 +141,7 @@ class DistrictHomePage(MetadataPageMixin, Page):
return self
class DistrictArticles(SharedSubpageMixin, MetadataPageMixin, Page):
class DistrictArticles(SubpageMixin, MetadataPageMixin, Page):
### FIELDS
max_items = models.IntegerField(
......@@ -183,7 +174,7 @@ class DistrictArticles(SharedSubpageMixin, MetadataPageMixin, Page):
return context
class DistrictContact(SharedSubpageMixin, MetadataPageMixin, Page):
class DistrictContact(SubpageMixin, MetadataPageMixin, Page):
class ContactItemBlock(blocks.StructBlock):
name = blocks.CharBlock(label="Role")
person = blocks.PageChooserBlock(
......@@ -208,7 +199,7 @@ class DistrictContact(SharedSubpageMixin, MetadataPageMixin, Page):
verbose_name = "Kontakty"
class DistrictTags(SharedSubpageMixin, MetadataPageMixin, Page):
class DistrictTags(SubpageMixin, MetadataPageMixin, Page):
settings_panels = []
......
......@@ -8,14 +8,14 @@ from django.db import models
from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.fields import ParentalKey
from taggit.models import TaggedItemBase
from wagtail.admin.edit_handlers import FieldPanel, HelpPanel
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.core.fields import RichTextField
from wagtail.core.models import Page
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtailmetadata.models import MetadataPageMixin
class SharedSubpageMixin:
class SubpageMixin:
"""Must be used in class definition before MetadataPageMixin!"""
@property
......@@ -74,7 +74,7 @@ class ArticleMixin(models.Model):
verbose_name = "Článek"
class Article(ArticleMixin, Page, SharedSubpageMixin, MetadataPageMixin):
class Article(ArticleMixin, Page, SubpageMixin, MetadataPageMixin):
""" Univerzalni clanek pro vsechny weby """
content_panels = Page.content_panels + [
......@@ -162,7 +162,7 @@ class Person(models.Model):
verbose_name = "Pirát"
class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
class PersonPage(SubpageMixin, MetadataPageMixin, Page):
"""Stranka Pirata v kontextu jednoho webu"""
person = models.ForeignKey(Person, on_delete=models.PROTECT, null=True)
......@@ -194,7 +194,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
return context
class PeoplePage(SharedSubpageMixin, MetadataPageMixin, Page):
class PeoplePage(SubpageMixin, MetadataPageMixin, Page):
""" Stranka se zobrazenim lidi v dane organizaci """
settings_panels = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment