[ckan-dev] package_update deletes existing information

Ross Jones ross at servercode.co.uk
Fri Feb 7 17:52:04 UTC 2014


Might adding allow_partial to the context when request.method == ‘PATCH’ work somewhere around https://github.com/ckan/ckan/blob/master/ckan/controllers/api.py#L55 ?

I seem to recall a PR adding proper support for allow_partial a while back.

Ross


On 7 Feb 2014, at 13:26, Ian Ward <ian at excess.org> wrote:

> There's a related issue[1] where I've suggested adding a
> package_update_partial action for this sort of thing. I think that's
> what you're looking for.
> 
> [1]: https://github.com/ckan/ckan/issues/1416
> 
> On Fri, Feb 7, 2014 at 6:43 AM, Austlid Hilde <hilde.austlid at vegvesen.no> wrote:
>> Hi,
>> 
>> If I use the API to update entries, I find that some existing information is deleted. For instance, if I use package_update to change the title of a package, I lose all resources, existing tags, and extra fields for that package, but keep description, license, maintainer, and author.
>> 
>> The brute force solution is, of course, to read all existing information when I want to do an update, and then add it back together with the new information. Is there a better solution?
>> 
>> Also, is this a bug which I should report on https://github.com/ckan/ckan/issues , or is there a reason for it to be this way?
>> 
>> Background info:
>> I use a python script based on the example on http://docs.ckan.org/en/latest/api/index.html#example-importing-datasets-with-the-ckan-api
>> I only have dictionary entries for the fields I want to touch. For instance, when I update a title, my dataset_dict = {'name': 'test_package', 'title': 'New title'}
>> I'm running CKAN 2.2, and using the latest version of the API.
>> 
>> Regards,
>> Hilde
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140207/5b40f46f/attachment-0003.html>


More information about the ckan-dev mailing list