【发布时间】:2011-09-28 18:51:40
【问题描述】:
目标:使用应用引擎的基本 webapp 框架,我想创建一个带有发布数据的新请求,以发送到另一个 RequestHandler。类似pageGenerator.post({'message':'the message','datum1':datum1,...})...
问题描述: 一个请求处理程序,称为pageGenerator,创建了一个带有表单的页面。当用户提交表单时,帖子会转到不同的处理程序:dataProcessor。如果dataProcessor 发现提交的数据有问题,它会将提交的数据和错误消息发送到“pageGenerator”的 post 方法,pageGenerator 会提供带有错误消息的页面。
如何像这样来回传递数据(和控制)?我希望pageGenerator 能够使用self.request.get('message') 获取数据。
【问题讨论】:
-
dataProcessor 需要成为 RequestHandler 有什么原因吗?如果只是 pageGenerator 内部调用的一些代码,不是更简单吗?
标签: python google-app-engine webapp2