def get_blog(id, request):
blog = yield from Blog.find(id) # ??id???????????
# ????????blog??????????????????????
comments = yield from Comment.findAll('blog_id=?', [id], orderBy='created_at desc')
# ?????????html??
for c in comments:
c.html_content = text2html(c.content)
# blog??markdown????????html??
blog.html_content = markdown2.markdown(blog.content)
return {
'__template__': 'blog.html',
'blog': blog,
'__user__':request.__user__,
'comments': comments
}
# day10???
# ???????
评论列表
文章目录