1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- from wagtail.contrib.modeladmin.options import (
- ModelAdmin, ModelAdminGroup, modeladmin_register)
- from bakerydemo.breads.models import Country, BreadType
- from bakerydemo.base.models import People, FooterText
- '''
- N.B. To see what icons are available for use in Wagtail menus and StreamField block types,
- enable the styleguide in settings:
- INSTALLED_APPS = (
- ...
- 'wagtail.contrib.wagtailstyleguide',
- ...
- )
- or see http://kave.github.io/general/2015/12/06/wagtail-streamfield-icons.html
- This demo project includes the full font-awesome set via CDN in base.html, so the entire
- font-awesome icon set is available to you. Options are at http://fontawesome.io/icons/.
- '''
- class BreadTypeAdmin(ModelAdmin):
-
-
- model = BreadType
- class BreadCountryAdmin(ModelAdmin):
- model = Country
- class BreadModelAdminGroup(ModelAdminGroup):
- menu_label = 'Bread Categories'
- menu_icon = 'fa-suitcase'
- menu_order = 200
- items = (BreadTypeAdmin, BreadCountryAdmin)
- class PeopleModelAdmin(ModelAdmin):
- model = People
- menu_label = 'People'
- menu_icon = 'fa-users'
- list_display = ('first_name', 'last_name', 'job_title', 'thumb_image')
- class FooterTextAdmin(ModelAdmin):
- model = FooterText
- class BakeryModelAdminGroup(ModelAdminGroup):
- menu_label = 'Bakery Misc'
- menu_icon = 'fa-cutlery'
- menu_order = 300
- items = (PeopleModelAdmin, FooterTextAdmin)
- modeladmin_register(BreadModelAdminGroup)
- modeladmin_register(BakeryModelAdminGroup)
|