示例#1
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/')
示例#2
0
文件: page.py 项目: jnydal/greenblog
    def post(self,key_name):
   
        if authenticatedUser(sessions.Session()):

            page = PageModel.get_by_key_name(key_name,parent=None)
            page.key_name = self.request.get('title').replace(' ','_')
            page.title = self.request.get('title')
            page.updated = DateTimeProperty.now()
            page.content = self.request.get('content')
            page.put();
            
            self.redirect('/')
            
        else:
            
            self.redirect('/login/')