Open fangsterr opened 10 years ago
Thanks for reporting this. I'll look into it.
We've seen a similar problem with a field default of "{}", which is intended to be an empty JSON object but gets encoded as the literal unicode string "{}"
. I couldn't figure out exactly where this goes wrong, so I applied a band-aid in our product: https://github.com/deis/deis/pull/1616
If anyone knows where this might be happening, I would love to debug it and push a fix back upstream to django-json-field. It's worked great for us other than this.
I create a new field on my model as such:
some_json_field = JSONField(default=[], blank=True)
However, when I generate the schemamigration (using python manage.py schemamigration appname --auto) and migrate, the field on existing model instances for the some_json_field are the string
"[]"
instead of[]