TaleLin / lin-cms-flask

🎀A simple and practical CMS implememted by Flask

Home Page:http://doc.cms.talelin.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.2.x falsk 处理 数据新增后 直接返回或者间接查询返回都会 会报错 no attribut '_fields'

hezygo opened this issue · comments

请详细描述您对本项目的任何问题,我们会在第一时间查阅和解决。
image

感谢反馈,这里的设计考虑不周,导致出现了此类问题。请尝试使用以下代码:

    item = KGNode.create(**node_info, commit=True)
    item.init_on_load()
    return jsonify(item)

感谢反馈,这里的设计考虑不周,导致出现了此类问题。请尝试使用以下代码:

    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)