handlers.py 文件源码

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

项目:xs-python-architecture 作者: xsingHu 项目源码 文件源码
def get_blog(id):
    blog = yield from Blog.find(id)
    comments = yield from Comment.findAll('blog_id=?', [id], orderBy='created_at desc')
    for c in comments:
        c.html_content = text2html(c.content)
    blog.html_content = markdown2.markdown(blog.content)
    return {
        '__template__': 'blog.html',
        'blog': blog,
        'comments': comments
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号