njpma/app/video/admin.py
2021-11-23 17:57:01 +01:00

27 lines
628 B
Python

import logging
import json
from django.contrib import admin
from django.db.models import JSONField
from . import models
from ..widgets import PrettyJSONWidget
logger = logging.getLogger(__name__)
@admin.decorators.register(models.Film)
class FilmAdmin(admin.ModelAdmin):
formfield_overrides = {
JSONField: {'widget': PrettyJSONWidget}
}
list_display = (
'__str__',
'position',
'slug',
'public',
)
list_editable = ['public', 'position']
list_filter = ['public', 'featured']
#@admin.decorators.register(models.Edit)
#class EditAdmin(admin.ModelAdmin):
# pass