app.py 文件源码

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

项目:hydrus 作者: HTTP-APIs 项目源码 文件源码
def delete(self, type_):
        """Delete a non Collection class item."""
        if get_authentication():
            if request.authorization is None:
                return failed_authentication()
            else:
                auth = check_authorization(request, get_session())
                if auth is False:
                    return failed_authentication()

        if checkEndpoint("DELETE", type_):
            # No Delete Operation for collections
            if type_ in get_doc().parsed_classes and type_+"Collection" not in get_doc().collections:
                try:
                    crud.delete_single(type_, session=get_session())
                    response = {"message": "Object successfully deleted"}
                    return set_response_headers(jsonify(response))
                except Exception as e:
                    status_code, message = e.get_HTTP()
                    return set_response_headers(jsonify(message), status_code=status_code)
        abort(405)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号