【发布时间】:2018-09-18 07:08:07
【问题描述】:
我正在使用 google appengine 开发一个网络应用程序。
我正在尝试更新表中的现有条目,但我的发布操作似乎不起作用。
发布脚本:
r = requests.post("http://localhost:8080", data={'type': 'user', 'id':
'11111', 'name': 'test'})
运行脚本时,控制台中没有错误,打印 r.text 时,我可以看到更新后的名称,但 localhost 上的页面没有显示更新后的名称,并且数据存储区用户仍然具有以前的名称。
我的主页模型是:
class Page(webapp2.RequestHandler):
def get(self):
...
def post(self):
user = User().get_user(self.request.get('id')) // query user from data store
user.name = self.request.get('name')
user.put()
// update jinja template
【问题讨论】:
标签: google-app-engine post webapp2