我可以在 CKAN 资源中附加额外内容吗?我注意到它ckan.model.Resource
有一个extras
属性,所以我尝试使用以下内容创建资源:
resource = {
"package_id": "my-package-id",
"url": "http://google.com",
"name": "Google",
"extras": [
{ "key": "myextra", "value": "my extra content" }
]
}
from ckan.plugins import toolkit
toolkit.get_action("resource_create")(faked_context, resource)
我跟着逻辑功能最终运行package_update
,但失败了ValidationError: {u' junk': u'The input field __junk was not expected.'}
谢谢!