I'm looking for a way to find the package_id for a resource in CKAN. I access the resource via the resource_show
action:
resource_dict = toolkit.get_action("resource_show")(context, {"id": "my-resource"})
The resulting dict does not tell me what package the resource belongs to. It does tell me:
resource_dict.get("package_id", None) == None # <<< True
resource_dict["resource_group_id"] = "some-uuid"
And I can see in my database that a resource_group
does have a package_id
attribute. However, there doesn't seem to be a resource_group_show
action.
Is there another way for me to navigate from a resource dict to its parent package?
Thanks!
In CKAN 2.3 and newer, package_id
is returned in the call to the resource_show
API call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With