[ckan-dev] Calling package_update removes resources

Ian Ward ian at excess.org
Wed Sep 28 17:44:04 UTC 2016


package_update replaces the whole package, including resources, with
values you provide.  Take a look at package_patch for updating
individual fields in the dataset metadata.

The package controller implements the edit page uses a hidden
"allow_partial_update" context flag to package_update that changes its
behaviour so that resources are kept when saving fields. This is only
possible from within ckan or an extension because the context isn't
something you can pass through the the HTTP API. I've been slowly
moving these hidden useful parameters from the context to a place that
normal API calls can access, but I haven't moved this one yet.


On Wed, Sep 28, 2016 at 1:01 PM, O'Leary, Jim <jim.oleary at vancouver.ca> wrote:
> I have noticed that when you call package_update, the resources that you
> have uploaded to the package disappear. Is this a bug or a feature? If it is
> a feature, what is the reasoning?
>
>
>
> Also, do the resources actually get deleted or are they just unlinked and
> still reside somewhere on the CKAN machine? This happens whether I use the
> Action API call or use the Python ckanapi module.
>
>
>
> Thanks
>
> Jim
>
> Jim O'Leary
>
> Programmer Analyst
>
> GIS and CADD Services Branch
>
> City of Vancouver
>
> Tel: 604.871.6295
>
> Fax: 604.871.6119
>
> 3rd Floor – 814 Richards St, Vancouver  BC V6B 3A7
>
>
>
>
> _______________________________________________
> 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
>



More information about the ckan-dev mailing list