price_list.py 文件源码

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

项目:stalker_pyramid 作者: eoyilmaz 项目源码 文件源码
def delete_good(request):
    """deletes the good with data from request
    """

    logger.debug('***delete good method starts ***')

    good_id = request.params.get('id')
    good = Good.query.filter_by(id=good_id).first()

    if not good:
        transaction.abort()
        return Response('There is no good with id: %s' % good_id, 500)

    good_name = good.name
    try:
        DBSession.delete(good)
        transaction.commit()
    except Exception as e:
        transaction.abort()
        c = StdErrToHTMLConverter(e)
        transaction.abort()
        return Response(c.html(), 500)

    return Response('Successfully deleted good with name %s' % good_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号