如何在django admin中使JSONField类型的django模型字段可编辑?
示例模型:
from django.contrib.postgres.fields import JSONField
from django.db import models
class AppModel(models.Model):
name = models.CharField(max_length=50)
data = JSONField()
PostgreSQL中的数据列示例:
data = {
"debug": "on",
"window": {
"title": "Sample Data",
"name": "main_window",
"attr":[{"width": 500},{"height": 500}]
},
"widget": true
}
示例,链接到示例将不胜感激。