Пример #1
0
 def get(self, post_id):
   from lib.blog import posts
   template_values = {
     'post': posts.get(post_id).toDict()
   }
   path = os.path.join(os.path.dirname(__file__), 'tools/editor.html')
   self.response.out.write(template.render(path, template_values))
Пример #2
0
    def get(self, post_id=None):

        from lib.blog import posts

        post = posts.get(post_id)

        if post == None:
            template_values = {}
            path = os.path.join(os.path.dirname(__file__), 'pages/404.html')
            self.response.out.write(template.render(path, template_values))
            return

        template_values = {'post': post.toDict()}
        path = os.path.join(os.path.dirname(__file__), 'pages/post.html')
        self.response.out.write(template.render(path, template_values))
Пример #3
0
 def get(self, post_id=None):
   
   from lib.blog import posts
   
   post = posts.get(post_id)
   
   if post == None:
     template_values = {}
     path = os.path.join(os.path.dirname(__file__), 'pages/404.html')
     self.response.out.write(template.render(path, template_values))
     return
   
   template_values = {
     'post': post.toDict()
   }
   path = os.path.join(os.path.dirname(__file__), 'pages/post.html')
   self.response.out.write(template.render(path, template_values))