def get(self, slug): post = memcache.get("post_"+slug) or \ Post.gql("WHERE slug = :1", slug).get() if post is None: self.error(404, slug) else: memcache.set("post_" + slug, post) post.content = utils.md_to_html(post.content) self.render("post.html", post=post)
def get(self, slug): post = memcache.get("post_"+slug) or \ Post.gql("WHERE slug = :1", slug).get() if post is None: self.error(404, slug) else: memcache.set("post_"+slug, post) post.content = utils.md_to_html(post.content) self.render("post.html", post=post)
def render_page(self, subject="", content="", draft=False, error=""): self.render("newpost.html", subject=subject, content=utils.md_to_html(content), draft=draft, error=error)
def get(self): posts = get_published_posts() for p in posts: p.content = utils.md_to_html(p.content) self.render("blog.html", blog_posts=posts)