Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)