At least part of the problem is that it looks so, so weird, and it's really tightly bound to models. This is like the most customized admin i've made and it's still pretty simple, but it sure doesn't feel that easy to reason about when you look at it (it's an admin page that lets you link a specific admin-page input to a model, then display it in a list that you can add to):
from django.contrib import admin
from django.forms import Textarea
from .models import *
# Register your models here.
class BotTextInline(admin.StackedInline):
model = BotReplyContent
extra = 1
fieldsets = [
(None, {'fields': ('message_type', 'text', ('template_text', 'example_text',), 'order',)}),
('Actions and inputs', {'classes': ('collapse,'), 'fields': ('action_type', 'input_type',)})
]
# readonly_fields = ['input_type_ptr']
class BotReplyAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ('state', 'intent', 'context', 'description', 'next_state',)}),
]
formfield_overrides = {
models.CharField: {'widget': Textarea()}
}
list_display = ('state', 'intent', 'context', 'description',)
save_as = True # lets you save the content on screen as a new id
inlines = [BotTextInline]
admin.site.register(BotReply, BotReplyAdmin)
```