njpma/app/video/admin.py

28 lines
616 B
Python
Raw Normal View History

import logging
import json
2021-09-28 15:10:22 +02:00
from django.contrib import admin
from django.db.models import JSONField
2021-09-28 15:10:22 +02:00
from . import models
from ..widgets import PrettyJSONWidget
logger = logging.getLogger(__name__)
2021-09-28 15:10:22 +02:00
@admin.decorators.register(models.Film)
class FilmAdmin(admin.ModelAdmin):
formfield_overrides = {
JSONField: {'widget': PrettyJSONWidget}
}
2021-10-11 13:55:45 +01:00
list_display = (
'__str__',
'position',
'slug',
'public',
)
list_editable = ['public', 'position']
list_filter = ['public']
2021-09-28 15:10:22 +02:00
2021-10-22 17:35:07 +01:00
#@admin.decorators.register(models.Edit)
#class EditAdmin(admin.ModelAdmin):
# pass