Exemple #1
0
 def post(self):
     page = self.request.get('page_Id')
     father = replaceStr(self.request.get('father'))
     code=replaceStr(self.request.get('code'))
     if not ContentClass.get_by_key_name(code):
         content = ContentClass(key_name=code)
         content.maincode = replaceStr(self.request.get('maincode'))
         content.title = replaceStr(self.request.get('title'))
         content.content = replaceStr(self.request.get('content'),'[()]')
         content.updateSpanTime = replaceStr(self.request.get('updateSpanTime'))
         content.father = father
         content.userName = replaceStr(self.request.get('userName'))
         content.replyType = replaceStr(self.request.get('replyType'))
         content.level = getLevelByCode(code)
         content.status = "1"
         content.put()
         logging.info(content.key().name())
         self.redirect('/contentList/%s?father=%s' %(page,father))
     else:
         self.redirect(self.request.environ['HTTP_REFERER'])
Exemple #2
0
 def post(self):
     pageId = self.request.get('page_id')
     father = self.request.get('father')
     code=self.request.get('code')
     content = ContentClass.get_by_key_name(code)
     if content:
             content.title = replaceStr(self.request.get('title'))
             content.content = replaceStr(self.request.get('content'),'[()]')
             content.updateSpanTime = replaceStr(self.request.get('updateSpanTime'))
             content.status = replaceStr(self.request.get('status'))
             content.userName = replaceStr(self.request.get('userName'))
             content.replyType = replaceStr(self.request.get('replyType'))
             content.put()
     self.redirect('/contentList/%s?father=%s' %(pageId,father))