def updatepost(): form =request.args # print request.data if form.has_key('post_id'): post=Post.getone(form['post_id']) post.title=form['title'] post.content=urllib.unquote(request.data).decode('utf-8') post.settags(form['tags']) post.update_time=int(time.time()) if form['posttype']=='saveonly': post.saveonly=True else : post.saveonly=False if form.has_key('allowcomment') and form['allowcomment']=='on': post.allowcomment=True else : post.allowcomment=False post.put_into() Tag.updatecache() return json.dumps({'message':'success','post_id':form['post_id']}) return "no such key exsits"
def updatepost(): form = request.args # print request.data if form.has_key('post_id'): post = Post.getone(form['post_id']) post.title = form['title'] post.content = urllib.unquote(request.data).decode('utf-8') post.settags(form['tags']) post.update_time = int(time.time()) if form['posttype'] == 'saveonly': post.saveonly = True else: post.saveonly = False if form.has_key('allowcomment') and form['allowcomment'] == 'on': post.allowcomment = True else: post.allowcomment = False post.put_into() Tag.updatecache() return json.dumps({'message': 'success', 'post_id': form['post_id']}) return "no such key exsits"
def post(post_id=None): post = None if post_id != None: post = Post.getone(post_id) return render_template('admin/post.html', post=post)