Skip to content
Permalink
Browse files

group Buyer's Guide menu items together on Wagtail admin (#4194)

  • Loading branch information
mmmavis committed Feb 13, 2020
1 parent e1965ab commit d0d7097891c547eab858a87501852488cf9da16e
Showing with 11 additions and 9 deletions.
  1. +11 −9 network-api/networkapi/buyersguide/admin.py
@@ -1,5 +1,5 @@
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
ModelAdmin, ModelAdminGroup, modeladmin_register)
from networkapi.buyersguide.models import Product
from networkapi.buyersguide.models import BuyersGuideProductCategory
from networkapi.buyersguide.models import Update
@@ -8,9 +8,8 @@
# Wagtail admin
class WagtailBuyersGuideAdmin(ModelAdmin):
model = Product
menu_label = 'Buyer\'s Guide'
menu_label = 'Products'
menu_icon = 'pick' # change as required
menu_order = 600 # will put in 3rd place (000 being 1st, 100 2nd)
add_to_settings_menu = False # or True to add your model to the Settings sub-menu
exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view

@@ -28,9 +27,8 @@ def get_published(self, obj):

class WagtailBuyersGuideCategoryAdmin(ModelAdmin):
model = BuyersGuideProductCategory
menu_label = 'Product Category'
menu_label = 'Product Categories'
menu_icon = 'pick' # change as required
menu_order = 600 # will put in 3rd place (000 being 1st, 100 2nd)
add_to_settings_menu = False # or True to add your model to the Settings sub-menu
exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view

@@ -42,13 +40,17 @@ class WagtailBuyersGuideUpdateAdmin(ModelAdmin):
model = Update
menu_label = 'Updates'
menu_icon = 'pick' # change as required
menu_order = 600 # will put in 3rd place (000 being 1st, 100 2nd)
add_to_settings_menu = False # or True to add your model to the Settings sub-menu
exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view
list_display = ('source', 'title')
search_fields = ('source', 'title')


modeladmin_register(WagtailBuyersGuideAdmin)
modeladmin_register(WagtailBuyersGuideCategoryAdmin)
modeladmin_register(WagtailBuyersGuideUpdateAdmin)
class WagtailBuyersGuideAdminGroup(ModelAdminGroup):
items = (WagtailBuyersGuideAdmin, WagtailBuyersGuideCategoryAdmin, WagtailBuyersGuideUpdateAdmin,)
menu_label = 'Buyer\'s Guide'
menu_icon = 'pick'
menu_order = 500


modeladmin_register(WagtailBuyersGuideAdminGroup)

0 comments on commit d0d7097

Please sign in to comment.
You can’t perform that action at this time.