You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
875 B
29 lines
875 B
from django.contrib import admin
|
|
from django.utils.translation import gettext_lazy as _
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from utils.admin import dovoodi_admin_site
|
|
from ..models import ContentRelease
|
|
|
|
|
|
class ContentReleaseAdmin(ModelAdmin):
|
|
"""Admin for ContentRelease model"""
|
|
list_display = ('version_name', 'published_at', 'is_active')
|
|
list_filter = ('is_active', 'published_at')
|
|
search_fields = ('version_name', 'description')
|
|
readonly_fields = ('published_at',)
|
|
ordering = ('-published_at',)
|
|
|
|
fieldsets = (
|
|
(None, {
|
|
'fields': ('version_name', 'description', 'is_active')
|
|
}),
|
|
(_('Timestamps'), {
|
|
'fields': ('published_at',),
|
|
'classes': ('collapse',)
|
|
}),
|
|
)
|
|
|
|
|
|
# Register model with the custom admin site
|
|
dovoodi_admin_site.register(ContentRelease, ContentReleaseAdmin)
|