def get(self, post_id):
"""
This renders home post page with content, comments and likes.
"""
key = db.Key.from_path('Post', int(post_id), parent=blog_key())
post = db.get(key)
comments = db.GqlQuery("select * from Comment where post_id = " +
post_id + " order by created desc")
likes = db.GqlQuery("select * from Like where post_id="+post_id)
if not post:
self.error(404)
return
error = self.request.get('error')
self.render("permalink.html", post=post, noOfLikes=likes.count(),
comments=comments, error=error)
评论列表
文章目录