def post(self): if self.cur_user and self.cur_user.flag==99: t_key = self.request.get('key') content = self.POST['content'] if t_key and content: t_obj = Comment.get_by_key_name(t_key) if t_obj: t_obj.con = textilize(content) db.run_in_transaction(obj_runput, t_obj) self.redirect('/edit-comment?key=%s'%str(t_key)) else: self.error(403) self.write('403:forbidden')
def post(self): if self.cur_user and self.cur_user.flag == 99: t_key = self.request.get('key') content = self.POST['content'] if t_key and content: t_obj = Comment.get_by_key_name(t_key) if t_obj: t_obj.con = textilize(content) db.run_in_transaction(obj_runput, t_obj) self.redirect('/edit-comment?key=%s' % str(t_key)) else: self.error(403) self.write('403:forbidden')
def get(self): if self.cur_user and self.cur_user.flag==99: t_key = self.request.get('key') if t_key: t_obj = Comment.get_by_key_name(t_key) else: t_obj = None self.echo('editcomment.html', { 'title': "修改评论", 't_obj': t_obj, }, layout='_layout.html') else: self.error(403) self.write('403:forbidden')