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