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/')
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/')