在Python Python Pyramid项目中,我通过add\u handler添加了几个视图类:
config.add_handler('export_index', '/export', handler=ExportViews, action='index')
class ExportViews(ConfigViewBase):
@action(request_method='POST', name='index',
request_param='ftp_export.form.submitted')
@action(request_method='POST', name='index', xhr=True, renderer='json',
request_param='ftp_export.form.submitted')
def ftp_export(self):
#process form
return {}
@action(request_method='GET')
def index(self):
return {}
有没有可能做到同样的事情:
^{pr2}$所以当browser获取页面时调用了u call_uu,在同一页面上发布表单时应该调用ftp_uexport。现在我得到page not found error
谢谢。在
你可以用遍历来实现。穿越岩石:)
然后您可以实现一组}接口,使它们从
ExportThis
和ExportThat
类,使它们实现IViewable
和{Root.__getitem__
返回,一切都神奇地工作。或者,如果不需要多个导出器,可以省略接口并将视图直接绑定到ExportSomething
类。或者您可以在getitem中实例化ExportSomething
的不同实例,并使其成为。。。我不知道,查看/导出不同的文件/报告。在相关问题 更多 >
编程相关推荐