0.2.x falsk 处理 数据新增后 直接返回或者间接查询返回都会 会报错 no attribut '_fields'
hezygo opened this issue · comments
HoLittlePig commented
sunlin92 commented
感谢反馈,这里的设计考虑不周,导致出现了此类问题。请尝试使用以下代码:
item = KGNode.create(**node_info, commit=True)
item.init_on_load()
return jsonify(item)
HoLittlePig commented
感谢反馈,这里的设计考虑不周,导致出现了此类问题。请尝试使用以下代码:
item = KGNode.create(**node_info, commit=True) item.init_on_load() return jsonify(item)
使用后
上面那种 能够正确序列化,但是数据为null
下面这种 能够正确序列化且有数据。
item_ = KGNode.create(**node_info, commit=True) item = KGNode.get(Id=item_.id) item.init_on_load() return jsonify(item)