谷歌appengine,ndb和Json

pra*_*n64 4 google-app-engine json app-engine-ndb

我有一个属性,我将其存储为JSON对象,如下所示:

content  = ndb.JsonProperty()
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我收到此错误:

   line 1614, in _to_base_type
    return json.dumps(value, 2)
AttributeError: 'module' object has no attribute 'dumps'
Run Code Online (Sandbox Code Playgroud)

在ndb模型类中.

因为ndb.TextProperty它工作正常.也许我发送JSON错误,这是我发送的JSON对象:

{posttext: "What is your earliest memory of WWII?", linkdata: ""}
Run Code Online (Sandbox Code Playgroud)

Gui*_*sum 11

你的应用程序中是否有一个名为'json.py'的模块或名为'json'的包?这将覆盖ndb尝试导入的json模块.解决方案是为该模块或包选择一个不同的名称.