예제 #1
0
    def get(self,id):

        user = authenticatedUser(sessions.Session())
        blogpost = BlogPostModel.get_by_id(int(id), parent=None)

        template_values = {
            'menulinks': menuLinks(),
            'user': user,
            'post': blogpost,          
        }

        path = os.path.join(os.path.dirname(__file__), 'editPost.html')
        self.response.out.write(template.render(path, template_values))
예제 #2
0
    def post(self,id):
   
        if authenticatedUser(sessions.Session()):

            blogpost = BlogPostModel.get_by_id(int(id), parent=None)
            blogpost.title = self.request.get('title')
            blogpost.content = self.request.get('content')
            blogpost.updated = DateTimeProperty.now()
            blogpost.put()
            
            self.redirect('/')
            
        else:
            
            self.redirect('/login/')
예제 #3
0
    def get(self,id):

        blogpost = BlogPostModel.get_by_id(int(id), parent=None)
        db.delete(blogpost)

        self.redirect('/')