def route_update(request): id = int(request.query.get('id', -1)) t = Tweet.find_by(id=id) form = request.form() t.content = form.get('content', '') t.save() return redirect('/')
def route_edit(request): id = int(request.query.get('id', -1)) t = Tweet.find_by(id=id) body = template('tweet_edit.html', t=t) return http_response(body)