def to_json(content):
"""Converts content to json while respecting config options."""
indent = None
separators = (',', ':')
try:
if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not request.is_xhr:
indent = 2
separators = (', ', ': ')
except:
pass
return json.dumps(content, indent=indent, separators=separators, cls=JsonEncoder)
评论列表
文章目录