“Cleaving” from this thread: Add JSON editor widget to Django Admin for JSON fields, inspired by @josdejong/jsoneditor · Issue #84 · django/new-features · GitHub
Problem: The json widget just dumps the json value as a single line and it’s pretty annoying to work with.
Solution? The requested feature was to supply a js based json editor. I think we should steer clear of more js addons… But what we can do is at least pretty print the JSON to make it easier to edit.
I think though, admin should at least pretty print json to make it easier to edit. Dealing with all that JSON in a single line is a headache.
Yep, last time I had an admin workflow on a JSON field, I provided a custom encoder that supplied the
indentarg; we should (likely*) just fixDjangoJSONEncoder.__init__()to use a defaultindentvalue. Should we cleave this off into a separate issue?(*) caveat: first impression, haven’t hunted yet for backwards-compat implications.
@jacobtylerwalls I don’t think we can modify DjangoJSONEncoder like that because it’s used with JsonResponse