Django Admin: JSONField default empty dict wont save in admin

前端 未结 4 1750
一向
一向 2021-02-19 11:42

in my model defn i have

from django.contrib.postgres.fields import JSONField
.....
.......
.........

media_data=JSONField(default=dict)

I crea

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-19 12:05

    Depending on your requirements, consider to use blank and/or null.

    media_data=JSONField(blank=True, null=True)

提交回复
热议问题