# Imports
from django.contrib import admin
# Exports
__all__ = (
"BaseDefaultAdmin",
)
# Models
[docs]class BaseDefaultAdmin(admin.ModelAdmin):
"""Add ``is_default`` to fields and list display/filter."""
[docs] def get_fields(self, request, obj=None):
a = super(BaseDefaultAdmin, self).get_fields(request, obj=obj)
a.append("is_default")
return a
[docs] def get_list_display(self, request):
a = super(BaseDefaultAdmin, self).get_list_display(request)
a.append("is_default")
return a
[docs] def get_list_filter(self, request):
a = super(BaseDefaultAdmin, self).get_list_display(request)
a.append("is_default")
return a