特牛网址导航

python-flask中Object of type 'Decimal' is not JSON serializable 报错_解决方法_class jsonencoder(_jsonencoder): def default(self,-CSDN博客

网友收藏
文章浏览阅读3.6k次。只需重写flask.json中的JSONEncoder方法from flask import Flask as _Flaskfrom flask.json import JSONEncoder as _JSONEncoderclass JSONEncoder(_JSONEncoder): def default(self, o): import decimal ..._class jsonencoder(_jsonencoder): def default(self, o): import decimal if isi