I have a django model as shown below:
from jsonfield import JSONField
class SCUser(User):
address = JSONField(blank=True,null=True)
When I save json in this address, it is saved as a string. Here is the code snippet:
appuser.address = {"state":""}
appuser.save()
Now, if I try to restore appuser.address, it gives me
>>>appuser.address
>>>u'{"state":""}'
>>>appuser.save()
>>>appuser.address
>>>u'"{\\"state\\":\\"\\"}"'
And it becomes recursive. What am I missing here?
Edit:
AppUser inherits from the SCUser model.
source
share