def PrepareForJson(obj):
tempObj = {}
dic = obj.__dict__
for key in dic:
if "__" not in key:
if not callable(dic[key]):
tempObj[key] = dic[key]
return tempObj
这个东西,获取出来其实json默认就变成了python基本数据类型
所以就可以去序列化啦。
-----------------------------------------------------------------------------------------------------------------------------------------