示例#1
0
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('/')
示例#2
0
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)