Thibaud Colas il y a 2 ans
Parent
commit
e68376f342

+ 0 - 0
bakerydemo/specials/__init__.py → bakerydemo/recipes/__init__.py


+ 4 - 4
bakerydemo/specials/blocks.py → bakerydemo/recipes/blocks.py

@@ -16,7 +16,7 @@ from wagtail.embeds.blocks import EmbedBlock
 from wagtail.images.blocks import ImageChooserBlock
 
 
-class SpecialTableBlock(StructBlock):
+class RecipeTableBlock(StructBlock):
     title = CharBlock()
     description = TextBlock()
     table = TypedTableBlock(
@@ -29,7 +29,7 @@ class SpecialTableBlock(StructBlock):
     )
 
 
-class SpecialStreamBlock(StreamBlock):
+class RecipeStreamBlock(StreamBlock):
     page = PageChooserBlock()
     embed = EmbedBlock()
     image = ImageChooserBlock()
@@ -49,6 +49,6 @@ BLOCKS = [
     ("document", DocumentChooserBlock()),
     ("embed", EmbedBlock()),
     ("image", ImageChooserBlock()),
-    ("table", SpecialTableBlock()),
-    ("stream", SpecialStreamBlock()),
+    ("table", RecipeTableBlock()),
+    ("stream", RecipeStreamBlock()),
 ]

+ 2 - 2
bakerydemo/specials/migrations/0001_initial.py → bakerydemo/recipes/migrations/0001_initial.py

@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
 
     operations = [
         migrations.CreateModel(
-            name="SpecialPage",
+            name="RecipePage",
             fields=[
                 (
                     "page_ptr",
@@ -393,7 +393,7 @@ class Migration(migrations.Migration):
                     modelcluster.fields.ParentalKey(
                         on_delete=django.db.models.deletion.CASCADE,
                         related_name="items",
-                        to="specials.specialpage",
+                        to="recipes.recipepage",
                     ),
                 ),
             ],

+ 0 - 0
bakerydemo/specials/migrations/__init__.py → bakerydemo/recipes/migrations/__init__.py


+ 3 - 3
bakerydemo/specials/models.py → bakerydemo/recipes/models.py

@@ -7,9 +7,9 @@ from wagtail.models import Orderable, Page
 from .blocks import BLOCKS
 
 
-class SpecialPage(Page):
+class RecipePage(Page):
     """
-    SpecialPage, to illustrate some special Wagtail scenario's
+    RecipePage, to illustrate some Recipe Wagtail scenario's
     """
 
     title_1 = models.CharField(max_length=255, default="Title 1")
@@ -44,7 +44,7 @@ class SpecialPage(Page):
 
 
 class Item(Orderable):
-    page = ParentalKey(SpecialPage, on_delete=models.CASCADE, related_name="items")
+    page = ParentalKey(RecipePage, on_delete=models.CASCADE, related_name="items")
     title_1 = models.CharField(max_length=255, default="Title 1")
     section_1 = StreamField(
         BLOCKS,

+ 1 - 1
bakerydemo/settings/base.py

@@ -39,7 +39,7 @@ INSTALLED_APPS = [
     "bakerydemo.blog",
     "bakerydemo.breads",
     "bakerydemo.locations",
-    "bakerydemo.specials",
+    "bakerydemo.recipes",
     "bakerydemo.search",
     "wagtail.contrib.search_promotions",
     "wagtail.contrib.forms",

+ 1 - 1
bakerydemo/templates/specials/special_page.html → bakerydemo/templates/specials/recipe_page.html

@@ -6,7 +6,7 @@
     <div class="container bread-detail">
         <div class="row">
             <div class="col-md-12">
-                <p>Special page is about admin capabilities and does not render content.</p>
+                <p>Recipe page is about admin capabilities and does not render content.</p>
             </div>
         </div>
     </div>