Pseudo-form in Django admin that generates a json object on save

前端 未结 7 1107
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-23 18:07

I have a model with a field for a json object. This object is used on the site to control some css variables, among other things.

Right now in the admin, I have a t

7条回答
  •  情深已故
    2020-12-23 18:43

    Try using YAML as the format for user input, and then deserialize the object and serialize it back to json in the back end. Django already has serializers for that.

提交回复
热议问题