api.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:py-jsonapi 作者: benediktschmitt 项目源码 文件源码
def dump_json(self, d):
        """
        Encodes the object *d* as JSON string.

        This method *can be overridden* if you want to use your own json
        serializer.

        The default implementation uses the :mod:`json` module of the standard
        library and (if available) the :mod:`bson` json utils.

        :arg d:
        :rtype: str
        """
        indent = 1 if self.debug else None
        if bson:
            return json.dumps(d, default=bson.json_util.default, indent=indent)
        else:
            return json.dumps(d, indent=indent)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号