Matt Westcott 2 年之前
父節點
當前提交
6d8c364115

+ 206 - 57
bakerydemo/base/migrations/0009_auto_20220823_1659.py

@@ -9,100 +9,249 @@ import wagtail_editable_help.models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('wagtailcore', '0040_page_draft_title'),
-        ('wagtailimages', '0024_index_image_file_hash'),
-        ('base', '0008_use_json_field_for_body_streamfield'),
+        ("wagtailcore", "0040_page_draft_title"),
+        ("wagtailimages", "0024_index_image_file_hash"),
+        ("base", "0008_use_json_field_for_body_streamfield"),
     ]
 
     operations = [
         migrations.AlterField(
-            model_name='gallerypage',
-            name='collection',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Gallery page collection', default='Select the image collection for this gallery.'), limit_choices_to=models.Q(('name__in', ['Root']), _negated=True), null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailcore.collection'),
+            model_name="gallerypage",
+            name="collection",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Gallery page collection",
+                    default="Select the image collection for this gallery.",
+                ),
+                limit_choices_to=models.Q(("name__in", ["Root"]), _negated=True),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                to="wagtailcore.collection",
+            ),
         ),
         migrations.AlterField(
-            model_name='gallerypage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="gallerypage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='gallerypage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Gallery page introduction', default='Text to describe the page')),
+            model_name="gallerypage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Gallery page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_1',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section 1', default='First featured section for the homepage. Will display up to three child items.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page', verbose_name='Featured section 1'),
+            model_name="homepage",
+            name="featured_section_1",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section 1",
+                    default="First featured section for the homepage. Will display up to three child items.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailcore.page",
+                verbose_name="Featured section 1",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_1_title',
-            field=models.CharField(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section title 1', default='Title to display above the promo copy'), max_length=255),
+            model_name="homepage",
+            name="featured_section_1_title",
+            field=models.CharField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section title 1",
+                    default="Title to display above the promo copy",
+                ),
+                max_length=255,
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_2',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section 2', default='Second featured section for the homepage. Will display up to three child items.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page', verbose_name='Featured section 2'),
+            model_name="homepage",
+            name="featured_section_2",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section 2",
+                    default="Second featured section for the homepage. Will display up to three child items.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailcore.page",
+                verbose_name="Featured section 2",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_2_title',
-            field=models.CharField(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section title 2', default='Title to display above the promo copy'), max_length=255),
+            model_name="homepage",
+            name="featured_section_2_title",
+            field=models.CharField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section title 2",
+                    default="Title to display above the promo copy",
+                ),
+                max_length=255,
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_3',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section 3', default='Third featured section for the homepage. Will display up to six child items.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page', verbose_name='Featured section 3'),
+            model_name="homepage",
+            name="featured_section_3",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section 3",
+                    default="Third featured section for the homepage. Will display up to six child items.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailcore.page",
+                verbose_name="Featured section 3",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='featured_section_3_title',
-            field=models.CharField(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page featured section title 3', default='Title to display above the promo copy'), max_length=255),
+            model_name="homepage",
+            name="featured_section_3_title",
+            field=models.CharField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page featured section title 3",
+                    default="Title to display above the promo copy",
+                ),
+                max_length=255,
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='hero_cta',
-            field=models.CharField(help_text=wagtail_editable_help.models.HelpText('Home page hero CTA', default='Text to display on Call to Action'), max_length=255, verbose_name='Hero CTA'),
+            model_name="homepage",
+            name="hero_cta",
+            field=models.CharField(
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page hero CTA", default="Text to display on Call to Action"
+                ),
+                max_length=255,
+                verbose_name="Hero CTA",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='hero_cta_link',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page CTA link', default='Choose a page to link to for the Call to Action'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page', verbose_name='Hero CTA link'),
+            model_name="homepage",
+            name="hero_cta_link",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page CTA link",
+                    default="Choose a page to link to for the Call to Action",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailcore.page",
+                verbose_name="Hero CTA link",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='hero_text',
-            field=models.CharField(help_text=wagtail_editable_help.models.HelpText('Home page hero text', default='Write an introduction for the bakery'), max_length=255),
+            model_name="homepage",
+            name="hero_text",
+            field=models.CharField(
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page hero text",
+                    default="Write an introduction for the bakery",
+                ),
+                max_length=255,
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="homepage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='promo_image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page promo image', default='Promo image'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="homepage",
+            name="promo_image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page promo image", default="Promo image"
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='promo_text',
-            field=wagtail.fields.RichTextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page promo text', default='Write some promotional copy'), null=True),
+            model_name="homepage",
+            name="promo_text",
+            field=wagtail.fields.RichTextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page promo text", default="Write some promotional copy"
+                ),
+                null=True,
+            ),
         ),
         migrations.AlterField(
-            model_name='homepage',
-            name='promo_title',
-            field=models.CharField(blank=True, help_text=wagtail_editable_help.models.HelpText('Home page promo title', default='Title to display above the promo copy'), max_length=255),
+            model_name="homepage",
+            name="promo_title",
+            field=models.CharField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Home page promo title",
+                    default="Title to display above the promo copy",
+                ),
+                max_length=255,
+            ),
         ),
         migrations.AlterField(
-            model_name='standardpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="standardpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='standardpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Standard page introduction', default='Text to describe the page')),
+            model_name="standardpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Standard page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
     ]

+ 65 - 24
bakerydemo/base/models.py

@@ -9,7 +9,6 @@ from wagtail.fields import RichTextField, StreamField
 from wagtail.models import Collection, Page
 from wagtail.search import index
 from wagtail.snippets.models import register_snippet
-
 from wagtail_editable_help.models import HelpText
 
 from .blocks import BaseStreamBlock
@@ -110,7 +109,9 @@ class StandardPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Standard page introduction", default="Text to describe the page"),
+        help_text=HelpText(
+            "Standard page introduction", default="Text to describe the page"
+        ),
         blank=True,
     )
     image = models.ForeignKey(
@@ -119,7 +120,10 @@ class StandardPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     body = StreamField(
         BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True
@@ -149,16 +153,23 @@ class HomePage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     hero_text = models.CharField(
         max_length=255,
-        help_text=HelpText("Home page hero text", default="Write an introduction for the bakery"),
+        help_text=HelpText(
+            "Home page hero text", default="Write an introduction for the bakery"
+        ),
     )
     hero_cta = models.CharField(
         verbose_name="Hero CTA",
         max_length=255,
-        help_text=HelpText("Home page hero CTA", default="Text to display on Call to Action"),
+        help_text=HelpText(
+            "Home page hero CTA", default="Text to display on Call to Action"
+        ),
     )
     hero_cta_link = models.ForeignKey(
         "wagtailcore.Page",
@@ -167,7 +178,10 @@ class HomePage(Page):
         on_delete=models.SET_NULL,
         related_name="+",
         verbose_name="Hero CTA link",
-        help_text=HelpText("Home page CTA link", default="Choose a page to link to for the Call to Action"),
+        help_text=HelpText(
+            "Home page CTA link",
+            default="Choose a page to link to for the Call to Action",
+        ),
     )
 
     # Body section of the HomePage
@@ -188,12 +202,18 @@ class HomePage(Page):
         help_text=HelpText("Home page promo image", default="Promo image"),
     )
     promo_title = models.CharField(
-        blank=True, max_length=255,
-        help_text=HelpText("Home page promo title", default="Title to display above the promo copy"),
+        blank=True,
+        max_length=255,
+        help_text=HelpText(
+            "Home page promo title", default="Title to display above the promo copy"
+        ),
     )
     promo_text = RichTextField(
-        null=True, blank=True,
-        help_text=HelpText("Home page promo text", default="Write some promotional copy"),
+        null=True,
+        blank=True,
+        help_text=HelpText(
+            "Home page promo text", default="Write some promotional copy"
+        ),
     )
 
     # Featured sections on the HomePage
@@ -202,8 +222,12 @@ class HomePage(Page):
     # Each list their children items that we access via the children function
     # that we define on the individual Page models e.g. BlogIndexPage
     featured_section_1_title = models.CharField(
-        blank=True, max_length=255,
-        help_text=HelpText("Home page featured section title 1", default="Title to display above the promo copy"),
+        blank=True,
+        max_length=255,
+        help_text=HelpText(
+            "Home page featured section title 1",
+            default="Title to display above the promo copy",
+        ),
     )
     featured_section_1 = models.ForeignKey(
         "wagtailcore.Page",
@@ -213,14 +237,18 @@ class HomePage(Page):
         related_name="+",
         help_text=HelpText(
             "Home page featured section 1",
-            default="First featured section for the homepage. Will display up to three child items."
+            default="First featured section for the homepage. Will display up to three child items.",
         ),
         verbose_name="Featured section 1",
     )
 
     featured_section_2_title = models.CharField(
-        blank=True, max_length=255,
-        help_text=HelpText("Home page featured section title 2", default="Title to display above the promo copy"),
+        blank=True,
+        max_length=255,
+        help_text=HelpText(
+            "Home page featured section title 2",
+            default="Title to display above the promo copy",
+        ),
     )
     featured_section_2 = models.ForeignKey(
         "wagtailcore.Page",
@@ -230,14 +258,18 @@ class HomePage(Page):
         related_name="+",
         help_text=HelpText(
             "Home page featured section 2",
-            default="Second featured section for the homepage. Will display up to three child items."
+            default="Second featured section for the homepage. Will display up to three child items.",
         ),
         verbose_name="Featured section 2",
     )
 
     featured_section_3_title = models.CharField(
-        blank=True, max_length=255,
-        help_text=HelpText("Home page featured section title 3", default="Title to display above the promo copy"),
+        blank=True,
+        max_length=255,
+        help_text=HelpText(
+            "Home page featured section title 3",
+            default="Title to display above the promo copy",
+        ),
     )
     featured_section_3 = models.ForeignKey(
         "wagtailcore.Page",
@@ -247,7 +279,7 @@ class HomePage(Page):
         related_name="+",
         help_text=HelpText(
             "Home page featured section 3",
-            default="Third featured section for the homepage. Will display up to six child items."
+            default="Third featured section for the homepage. Will display up to six child items.",
         ),
         verbose_name="Featured section 3",
     )
@@ -314,15 +346,21 @@ class GalleryPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Gallery page introduction", default="Text to describe the page"),
-        blank=True)
+        help_text=HelpText(
+            "Gallery page introduction", default="Text to describe the page"
+        ),
+        blank=True,
+    )
     image = models.ForeignKey(
         "wagtailimages.Image",
         null=True,
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     body = StreamField(
         BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True
@@ -333,7 +371,10 @@ class GalleryPage(Page):
         null=True,
         blank=True,
         on_delete=models.SET_NULL,
-        help_text=HelpText("Gallery page collection", default="Select the image collection for this gallery."),
+        help_text=HelpText(
+            "Gallery page collection",
+            default="Select the image collection for this gallery.",
+        ),
     )
 
     content_panels = Page.content_panels + [

+ 44 - 14
bakerydemo/blog/migrations/0006_auto_20220823_1659.py

@@ -8,29 +8,59 @@ import wagtail_editable_help.models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('wagtailimages', '0024_index_image_file_hash'),
-        ('blog', '0005_use_json_field_for_body_streamfield'),
+        ("wagtailimages", "0024_index_image_file_hash"),
+        ("blog", "0005_use_json_field_for_body_streamfield"),
     ]
 
     operations = [
         migrations.AlterField(
-            model_name='blogindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="blogindexpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='blogindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Blog index page introduction', default='Text to describe the page')),
+            model_name="blogindexpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Blog index page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
         migrations.AlterField(
-            model_name='blogpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="blogpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='blogpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Blog page introduction', default='Text to describe the page')),
+            model_name="blogpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Blog page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
     ]

+ 15 - 6
bakerydemo/blog/models.py

@@ -11,7 +11,6 @@ from wagtail.contrib.routable_page.models import RoutablePageMixin, route
 from wagtail.fields import StreamField
 from wagtail.models import Orderable, Page
 from wagtail.search import index
-
 from wagtail_editable_help.models import HelpText
 
 from bakerydemo.base.blocks import BaseStreamBlock
@@ -57,7 +56,9 @@ class BlogPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Blog page introduction", default="Text to describe the page"),
+        help_text=HelpText(
+            "Blog page introduction", default="Text to describe the page"
+        ),
         blank=True,
     )
     image = models.ForeignKey(
@@ -66,7 +67,10 @@ class BlogPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     body = StreamField(
         BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True
@@ -136,8 +140,10 @@ class BlogIndexPage(RoutablePageMixin, Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Blog index page introduction", default="Text to describe the page"),
-        blank=True
+        help_text=HelpText(
+            "Blog index page introduction", default="Text to describe the page"
+        ),
+        blank=True,
     )
     image = models.ForeignKey(
         "wagtailimages.Image",
@@ -145,7 +151,10 @@ class BlogIndexPage(RoutablePageMixin, Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
 
     content_panels = Page.content_panels + [

+ 45 - 14
bakerydemo/breads/migrations/0005_auto_20220823_1659.py

@@ -8,29 +8,60 @@ import wagtail_editable_help.models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('wagtailimages', '0024_index_image_file_hash'),
-        ('breads', '0004_use_json_field_for_body_streamfield'),
+        ("wagtailimages", "0024_index_image_file_hash"),
+        ("breads", "0004_use_json_field_for_body_streamfield"),
     ]
 
     operations = [
         migrations.AlterField(
-            model_name='breadpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="breadpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='breadpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Bread page introduction', default='Text to describe the page')),
+            model_name="breadpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Bread page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
         migrations.AlterField(
-            model_name='breadsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="breadsindexpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='breadsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Breads index page introduction', default='Text to describe the page')),
+            model_name="breadsindexpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Breads index page introduction",
+                    default="Text to describe the page",
+                ),
+            ),
         ),
     ]

+ 15 - 6
bakerydemo/breads/models.py

@@ -7,7 +7,6 @@ from wagtail.fields import StreamField
 from wagtail.models import Page
 from wagtail.search import index
 from wagtail.snippets.models import register_snippet
-
 from wagtail_editable_help.models import HelpText
 
 from bakerydemo.base.blocks import BaseStreamBlock
@@ -87,8 +86,10 @@ class BreadPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Bread page introduction", default="Text to describe the page"),
-        blank=True
+        help_text=HelpText(
+            "Bread page introduction", default="Text to describe the page"
+        ),
+        blank=True,
     )
     image = models.ForeignKey(
         "wagtailimages.Image",
@@ -96,7 +97,10 @@ class BreadPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     body = StreamField(
         BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True
@@ -157,7 +161,9 @@ class BreadsIndexPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Breads index page introduction", default="Text to describe the page"),
+        help_text=HelpText(
+            "Breads index page introduction", default="Text to describe the page"
+        ),
         blank=True,
     )
     image = models.ForeignKey(
@@ -166,7 +172,10 @@ class BreadsIndexPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
 
     content_panels = Page.content_panels + [

+ 71 - 20
bakerydemo/locations/migrations/0006_auto_20220823_1659.py

@@ -9,39 +9,90 @@ import wagtail_editable_help.models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('wagtailimages', '0024_index_image_file_hash'),
-        ('locations', '0005_use_json_field_for_body_streamfield'),
+        ("wagtailimages", "0024_index_image_file_hash"),
+        ("locations", "0005_use_json_field_for_body_streamfield"),
     ]
 
     operations = [
         migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='closed',
-            field=models.BooleanField(blank=True, help_text=wagtail_editable_help.models.HelpText('Operating hours closed', default='Tick if location is closed on this day'), verbose_name='Closed?'),
+            model_name="locationoperatinghours",
+            name="closed",
+            field=models.BooleanField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Operating hours closed",
+                    default="Tick if location is closed on this day",
+                ),
+                verbose_name="Closed?",
+            ),
         ),
         migrations.AlterField(
-            model_name='locationpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="locationpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='locationpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Location page introduction', default='Text to describe the page')),
+            model_name="locationpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Location page introduction", default="Text to describe the page"
+                ),
+            ),
         ),
         migrations.AlterField(
-            model_name='locationpage',
-            name='lat_long',
-            field=models.CharField(help_text=wagtail_editable_help.models.HelpText('Location page lat/long', default="Comma separated lat/long. (Ex. 64.144367, -21.939182) Right click Google Maps and select 'What's Here'"), max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma-separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')]),
+            model_name="locationpage",
+            name="lat_long",
+            field=models.CharField(
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Location page lat/long",
+                    default="Comma separated lat/long. (Ex. 64.144367, -21.939182) Right click Google Maps and select 'What's Here'",
+                ),
+                max_length=36,
+                validators=[
+                    django.core.validators.RegexValidator(
+                        code="invalid_lat_long",
+                        message="Lat Long must be a comma-separated numeric lat and long",
+                        regex="^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$",
+                    )
+                ],
+            ),
         ),
         migrations.AlterField(
-            model_name='locationsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text=wagtail_editable_help.models.HelpText('Hero image', default='Landscape mode only; horizontal width between 1000px and 3000px.'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
+            model_name="locationsindexpage",
+            name="image",
+            field=models.ForeignKey(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Hero image",
+                    default="Landscape mode only; horizontal width between 1000px and 3000px.",
+                ),
+                null=True,
+                on_delete=django.db.models.deletion.SET_NULL,
+                related_name="+",
+                to="wagtailimages.image",
+            ),
         ),
         migrations.AlterField(
-            model_name='locationsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text=wagtail_editable_help.models.HelpText('Locations index page introduction', default='Text to describe the page')),
+            model_name="locationsindexpage",
+            name="introduction",
+            field=models.TextField(
+                blank=True,
+                help_text=wagtail_editable_help.models.HelpText(
+                    "Locations index page introduction",
+                    default="Text to describe the page",
+                ),
+            ),
         ),
     ]

+ 20 - 8
bakerydemo/locations/models.py

@@ -8,7 +8,6 @@ from wagtail.admin.panels import FieldPanel, InlinePanel
 from wagtail.fields import StreamField
 from wagtail.models import Orderable, Page
 from wagtail.search import index
-
 from wagtail_editable_help.models import HelpText
 
 from bakerydemo.base.blocks import BaseStreamBlock
@@ -24,8 +23,11 @@ class OperatingHours(models.Model):
     opening_time = models.TimeField(blank=True, null=True)
     closing_time = models.TimeField(blank=True, null=True)
     closed = models.BooleanField(
-        "Closed?", blank=True,
-        help_text=HelpText("Operating hours closed", default="Tick if location is closed on this day"),
+        "Closed?",
+        blank=True,
+        help_text=HelpText(
+            "Operating hours closed", default="Tick if location is closed on this day"
+        ),
     )
 
     panels = [
@@ -71,7 +73,9 @@ class LocationsIndexPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Locations index page introduction", default="Text to describe the page"),
+        help_text=HelpText(
+            "Locations index page introduction", default="Text to describe the page"
+        ),
         blank=True,
     )
     image = models.ForeignKey(
@@ -80,7 +84,10 @@ class LocationsIndexPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
 
     # Only LocationPage objects can be added underneath this index page
@@ -114,8 +121,10 @@ class LocationPage(Page):
     """
 
     introduction = models.TextField(
-        help_text=HelpText("Location page introduction", default="Text to describe the page"),
-        blank=True
+        help_text=HelpText(
+            "Location page introduction", default="Text to describe the page"
+        ),
+        blank=True,
     )
     image = models.ForeignKey(
         "wagtailimages.Image",
@@ -123,7 +132,10 @@ class LocationPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name="+",
-        help_text=HelpText("Hero image", default="Landscape mode only; horizontal width between 1000px and 3000px."),
+        help_text=HelpText(
+            "Hero image",
+            default="Landscape mode only; horizontal width between 1000px and 3000px.",
+        ),
     )
     body = StreamField(
         BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True