Source code for superdjango.db.published.admin

# Imports

from django.contrib import admin
from .filters import PublishedByListFilter

# Exports

__all__ = (
    "BasePublishedByModelAdmin",
)

# Models


[docs]class BasePublishedByModelAdmin(admin.ModelAdmin): """Base admin class for models implementing the ``PublishedByModel``."""
[docs] def get_list_display(self, request): a = super().get_list_display(request) a.append("is_published") a.append("published_dt") a.append("published_by") return a
[docs] def get_list_filter(self, request): a = super().get_list_filter(request) a.append("is_published") a.append(PublishedByListFilter) return a