categories.py 文件源码

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

项目:expenses-diary-api 作者: otrabalhador 项目源码 文件源码
def patch(self, id=None):

        try:
            content = validate_update_columns(request.get_json(), UPDATEABLE_COLUMNS)
            logger.info("Request Body: {content}".format(content=content))

            conn = db_conn()

            for key, value in content.items():
                arguments = (AsIs(key), value, id)
                execute(conn, UPDATE_CATEGORY, arguments)
            conn.close()

            return status_ok.modified()
        except KeyError as error:
            logger.info(error)
            return invalid_fields(error.fields)
        except Exception as error:
            logger.info(error)
            return unexpected_error()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号