【发布时间】:2011-04-08 17:37:34
【问题描述】:
按照 Cherrypy 的tutorial,从页面类“内”的表单接收数据似乎相当容易。现在,我尝试将参数传递给 另一个 页面类的索引页面,如下所示:
在我的根索引页面中,我有以下表单:
<form action="otherpage" method="post">
<input type="text" name="arg1">
...
</form>
而接收页面的类是这样的:
class OtherPage:
def index(self, arg1=None):
return arg1
它的安装方式像
root.otherpage = Otherpage()
无论我在表单中输入什么,它总是显示一个空白页面,所以我猜它没有正确传递参数“arg”。你看出什么问题了吗?
【问题讨论】: