blog.py 文件源码

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

项目:M101P-mongodb-course-2016 作者: mahasagar 项目源码 文件源码
def post_comment_like():
    permalink = bottle.request.forms.get("permalink")
    permalink = cgi.escape(permalink)

    comment_ordinal_str = bottle.request.forms.get("comment_ordinal")

    comment_ordinal = int(comment_ordinal_str)

    post = posts.get_post_by_permalink(permalink)
    if post is None:
        bottle.redirect("/post_not_found")
        return

    # it all looks good. increment the ordinal
    posts.increment_likes(permalink, comment_ordinal)

    bottle.redirect("/post/" + permalink)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号