I have an attribute that I'm storing as a JSON object, like so:
content = ndb.JsonProperty()
When I do this, I get this error:
line 1614, in _to_base_type
return json.dumps(value, 2)
AttributeError: 'module' object has no attribute 'dumps'
inside the ndb model class.
As a ndb.TextProperty
it works properly. Maybe I'm sending the JSON wrong, this is the JSON object I'm sending:
{posttext: "What is your earliest memory of WWII?", linkdata: ""}
Do you perhaps have a module named 'json.py' or a package named 'json' in your app? That would override the json module that ndb is trying to import. The solution is to pick a different name for that module or package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With