json - Django JSONField: Unexpected array element -
i trying save record jsonfield in django declared this:
class myclass(models.model): myfield = jsonfield()
with code fragment:
myclass.objects.create(myfield = {'a': 1, 'b': 2})
but results in
dataerror: malformed array literal: "{"a": 1, "b": 2}" line 1: ... '{"a": 1, ... ^ detail: unexpected array element.
i trying following example described here: https://docs.djangoproject.com/en/1.10/ref/contrib/postgres/fields/
can point out missing here please?
Comments
Post a Comment