瀏覽代碼

rename mixin

David Ray 8 年之前
父節點
當前提交
f30ec597a2
共有 4 個文件被更改,包括 9 次插入9 次删除
  1. 3 3
      bakerydemo/base/models.py
  2. 2 2
      bakerydemo/blog/models.py
  3. 2 2
      bakerydemo/breads/models.py
  4. 2 2
      bakerydemo/locations/models.py

+ 3 - 3
bakerydemo/base/models.py

@@ -21,7 +21,7 @@ from wagtail.wagtailsnippets.models import register_snippet
 from .blocks import BaseStreamBlock
 from .blocks import BaseStreamBlock
 
 
 
 
-class CommonPageFieldsMixin(models.Model):
+class BasePageFieldsMixin(models.Model):
     """
     """
     An abstract base class for common fields
     An abstract base class for common fields
     """
     """
@@ -197,7 +197,7 @@ class HomePage(Page):
         return self.title
         return self.title
 
 
 
 
-class GalleryPage(CommonPageFieldsMixin, Page):
+class GalleryPage(BasePageFieldsMixin, Page):
     """
     """
     This is a page to list all the locations on the site
     This is a page to list all the locations on the site
     """
     """
@@ -210,7 +210,7 @@ class GalleryPage(CommonPageFieldsMixin, Page):
         help_text='Select the image collection for this gallery.'
         help_text='Select the image collection for this gallery.'
     )
     )
 
 
-    content_panels = CommonPageFieldsMixin.content_panels + [
+    content_panels = BasePageFieldsMixin.content_panels + [
         FieldPanel('choices'),
         FieldPanel('choices'),
     ]
     ]
 
 

+ 2 - 2
bakerydemo/blog/models.py

@@ -20,7 +20,7 @@ from wagtail.wagtailsearch import index
 from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
 from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
 
 
 from bakerydemo.base.blocks import BaseStreamBlock
 from bakerydemo.base.blocks import BaseStreamBlock
-from bakerydemo.base.models import CommonPageFieldsMixin
+from bakerydemo.base.models import BasePageFieldsMixin
 
 
 
 
 class BlogPeopleRelationship(Orderable, models.Model):
 class BlogPeopleRelationship(Orderable, models.Model):
@@ -117,7 +117,7 @@ class BlogPage(Page):
     subpage_types = []
     subpage_types = []
 
 
 
 
-class BlogIndexPage(CommonPageFieldsMixin, RoutablePageMixin, Page):
+class BlogIndexPage(BasePageFieldsMixin, RoutablePageMixin, Page):
     """
     """
     Index page for blogs.
     Index page for blogs.
     We need to alter the page model's context to return the child page objects - the
     We need to alter the page model's context to return the child page objects - the

+ 2 - 2
bakerydemo/breads/models.py

@@ -10,7 +10,7 @@ from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsnippets.models import register_snippet
 from wagtail.wagtailsnippets.models import register_snippet
 
 
-from bakerydemo.base.models import CommonPageFieldsMixin
+from bakerydemo.base.models import BasePageFieldsMixin
 
 
 
 
 @register_snippet
 @register_snippet
@@ -97,7 +97,7 @@ class BreadPage(Page):
     api_fields = ['title', 'bread_type', 'origin', 'image']
     api_fields = ['title', 'bread_type', 'origin', 'image']
 
 
 
 
-class BreadsIndexPage(CommonPageFieldsMixin, Page):
+class BreadsIndexPage(BasePageFieldsMixin, Page):
     """
     """
     Index page for breads. We don't have any fields within our model but we need
     Index page for breads. We don't have any fields within our model but we need
     to alter the page model's context to return the child page objects - the
     to alter the page model's context to return the child page objects - the

+ 2 - 2
bakerydemo/locations/models.py

@@ -8,7 +8,7 @@ from wagtail.wagtailcore.models import Orderable, Page
 from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsearch import index
 
 
-from bakerydemo.base.models import CommonPageFieldsMixin
+from bakerydemo.base.models import BasePageFieldsMixin
 
 
 
 
 class OperatingHours(models.Model):
 class OperatingHours(models.Model):
@@ -64,7 +64,7 @@ class LocationOperatingHours(Orderable, OperatingHours):
     )
     )
 
 
 
 
-class LocationsIndexPage(CommonPageFieldsMixin, Page):
+class LocationsIndexPage(BasePageFieldsMixin, Page):
     """
     """
     Index page for locations
     Index page for locations
     """
     """