-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide example of how to use the new package_revise #181
Comments
The remote CKAN action API may be called in one of three ways:
only number 3 can be used when uploading files, so JSON can't be used to nest the other parameter values sent as part of the same call. myckan.call_action(
'package_revise',
{'match': '{"name":"MyDataset"}'}, # values need to be JSON strings when uploading files
files={'update__resources__1__upload': myfile},
) I could update ckanapi to automatically convert lists and dictionaries at the top level of multipart POST requests to their JSON versions, but as far as I know only |
Thanks! Is there any reason to use package_update any more? |
no, but |
What about |
@ghost [EDIT: I guess it's the right time here to talk to ghosts] |
How do I use the new CKAN 2.9 function package_revise?
Currently to do a resource update with file upload, I can do something like:
Let's say I have a dataset with name "MyDataset" I want to update, removing resources 0 and 2, updating the description of resource 1 and uploading a new file for resource 1. I understand from documentation that the parameters would be something like:
Can you show in code how I pass those things in the call_action? For example, do they all go in the second parameter (data_dict) and if so, how does the file upload one go in there since it isn't a key value pair? Do I still need to use the "files" parameter?
The text was updated successfully, but these errors were encountered: