public-health-ch/feedler/wagtail_hooks.py

30 lines
812 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-10-14 21:57:39 +00:00
from .admin import EntryModelAdminMixin
2017-07-03 14:01:44 +00:00
from .models import Entry, Stream
2017-07-03 11:36:01 +00:00
2017-10-14 21:57:39 +00:00
class EntryModelAdmin(EntryModelAdminMixin, ModelAdmin):
2017-07-03 11:36:01 +00:00
model = Entry
menu_icon = 'date'
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = True
2017-07-03 14:01:44 +00:00
list_filter = ('author', 'tags')
2017-09-14 16:25:10 +00:00
list_display = ('published', 'title', 'with_image', 'lang')
2017-07-03 14:01:44 +00:00
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'
2017-10-16 08:59:59 +00:00
menu_order = 900
2017-07-03 14:01:44 +00:00
add_to_settings_menu = True
exclude_from_explorer = True
list_display = ('title', 'ident')
modeladmin_register(StreamModelAdmin)