def json_all_comments(entity, entity_id): comments = Comment.get_for(entity, entity_id, lazy=False) comments = {'data': [get_comment_json(comment) for comment in comments]} return jsonify(comments)