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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -