public-health-ch/feedler/wagtail_hooks.py

29 lines
749 B
Python
Raw Normal View History

2017-07-03 11:36:01 +00:00
# -*- coding: utf-8 -*-
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
2017-07-03 14:01:44 +00:00
from .models import Entry, Stream
2017-07-03 11:36:01 +00:00
class EntryModelAdmin(ModelAdmin):
model = Entry
menu_icon = 'date'
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = True
2017-09-14 07:56:38 +00:00
list_display = ('published', 'title', 'no_image', 'lang')
2017-07-03 14:01:44 +00:00
list_filter = ('author', 'tags')
search_fields = ('title', 'author', 'content', 'tags')
2017-07-03 11:36:01 +00:00
modeladmin_register(EntryModelAdmin)
2017-07-03 14:01:44 +00:00
class StreamModelAdmin(ModelAdmin):
model = Stream
menu_icon = 'date'
menu_order = 1000
add_to_settings_menu = True
exclude_from_explorer = True
list_display = ('title', 'ident')
modeladmin_register(StreamModelAdmin)