从另一个分机调用分机中的函数。

问题描述 投票:0回答:1

我是一个新的ckan & python,所以感谢你的任何反馈。

我在一个CKAN扩展中设置了这个路由(即 exporter):

def after_map(self, m):
  m.connect('export', Export.route_path, controller='ckanext.export.plugin:ExportController', action='generate_export')

我如何从其他分机上调用该路由(即: 进口商)?

CKAN有这样的东西吗?

helper.call_route(controller='ckanext.export.plugin:ExportController', action='generate_export')
# OR
helper.call_named('export')

的东西,我可以从里面调用 进口商 扩展,以访问该 生成出口 方法?

或者是获取另一个CKAN扩展中可用的动作列表,然后调用'generate_export'方法?

ckan
1个回答
0
投票

你是否已经考虑过尝试使用 get_action 功能,是由插件工具箱提供的吗?

它的描述是 此处 :)

© www.soinside.com 2019 - 2024. All rights reserved.