phantasma/app/video/admin.py

27 lines
616 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']
#@admin.decorators.register(models.Edit)
#class EditAdmin(admin.ModelAdmin):
# pass