當前位置:成語大全網 - 新華字典 - 如何將 Flask SQLAlchemy amp;Peewee 的查詢結果轉換成 json

如何將 Flask SQLAlchemy amp;Peewee 的查詢結果轉換成 json

import jsonfb = dict(db.session.query(Feedback.amp,Feedback.Peewee ).filter(Feedback.id==int(fdid)).all())print json.dumps(fb)ps:先查出Feedback 表的 倆個字段 amp,peewee 把它打成字典 dict()然後 json.dumps(fb) 轉換為json