[ckan-dev] Access package_id from resource_dict

Ryan Clark ryan.clark at azgs.az.gov
Thu Jul 18 00:16:41 UTC 2013


I posted this on StackOverflow last week and got no love so I thought I'd try here.

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!

http://stackoverflow.com/questions/17603983/access-package-id-from-resource-dict-in-ckan


____________________

Ryan Clark
Arizona Geological Survey
ryan.clark at azgs.az.gov
(520) 302-4871
facebook.com/ModernGeologist
@worbly









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130717/b9f4e7c0/attachment.html>


More information about the ckan-dev mailing list