Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Imports
3from django.contrib import admin
4from .filters import PublishedByListFilter
6# Exports
8__all__ = (
9 "BasePublishedByModelAdmin",
10)
12# Models
15class BasePublishedByModelAdmin(admin.ModelAdmin):
16 """Base admin class for models implementing the ``PublishedByModel``."""
18 def get_list_display(self, request):
19 a = super().get_list_display(request)
21 a.append("is_published")
22 a.append("published_dt")
23 a.append("published_by")
25 return a
27 def get_list_filter(self, request):
28 a = super().get_list_filter(request)
30 a.append("is_published")
31 a.append(PublishedByListFilter)
33 return a