|
@@ -4,7 +4,6 @@ from wagtail.snippets.models import register_snippet
|
|
|
from wagtail.snippets.views.snippets import SnippetViewSet, SnippetViewSetGroup
|
|
|
|
|
|
from bakerydemo.base.models import FooterText, Person
|
|
|
-from bakerydemo.breads.models import BreadIngredient, BreadType, Country
|
|
|
|
|
|
"""
|
|
|
N.B. To see what icons are available for use in Wagtail menus and StreamField block types,
|
|
@@ -43,32 +42,12 @@ def replace_userbar_accessibility_item(request, items):
|
|
|
]
|
|
|
|
|
|
|
|
|
-class BreadIngredientViewSet(SnippetViewSet):
|
|
|
-
|
|
|
-
|
|
|
- model = BreadIngredient
|
|
|
- search_fields = ("name",)
|
|
|
- inspect_view_enabled = True
|
|
|
-
|
|
|
-
|
|
|
-class BreadTypeViewSet(SnippetViewSet):
|
|
|
- model = BreadType
|
|
|
- search_fields = ("title",)
|
|
|
-
|
|
|
-
|
|
|
-class BreadCountryViewSet(SnippetViewSet):
|
|
|
- model = Country
|
|
|
- search_fields = ("title",)
|
|
|
-
|
|
|
-
|
|
|
-class BreadSnippetViewSetGroup(SnippetViewSetGroup):
|
|
|
- menu_label = "Bread Categories"
|
|
|
- menu_icon = "suitcase"
|
|
|
- menu_order = 200
|
|
|
- items = (BreadIngredientViewSet, BreadTypeViewSet, BreadCountryViewSet)
|
|
|
-
|
|
|
-
|
|
|
class PersonViewSet(SnippetViewSet):
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
model = Person
|
|
|
menu_label = "People"
|
|
|
icon = "group"
|
|
@@ -92,5 +71,4 @@ class BakerySnippetViewSetGroup(SnippetViewSetGroup):
|
|
|
|
|
|
|
|
|
|
|
|
-register_snippet(BreadSnippetViewSetGroup)
|
|
|
register_snippet(BakerySnippetViewSetGroup)
|