3👍
✅
Answering my own question…
After reading the documentation near what Matthew J Morrison pointed me to. I discovered I could add a javascript to alter things.
to my ModelAdmin I added
class Media:
js = ("/site_media/json2.js", "/site_media/custom.js")
json2.js is from Douglas Crockford’s website
custom.js is
django.jQuery(document).ready(function() {
data = JSON.parse(django.jQuery("#id_json")[0].value);
django.jQuery("#id_json")[0].value = JSON.stringify(data, null, 4)
});
Easy when you know how.
1👍
Maybe create a custom widget…
- [Django]-Framework/Language for new web 2.0 sites (2008 and 2009)
- [Django]-How to copy an object from one model to another model
- [Django]-Django raw SQL query – looping over result, it executes a query for every iteration
- [Django]-In Python, what's the best way to log exceptions to a file?
- [Django]-Migrate existing live Django site from one server to another along with user records intact
Source:stackexchange.com