[ckan-dev] No resource views created on package_update() API call. Is that on purpose ?

Matthew Fullerton matt.fullerton at gmail.com
Fri Oct 26 06:24:10 UTC 2018


This might be relevant:
https://github.com/ckan/ckan/issues/3560

-Matt

On Thu, 25 Oct 2018 at 11:52, Adrià Mercader <adria.mercader at okfn.org>
wrote:

> Hi Alex,
>
> This is on me as I wrote the code but I can't remember the specifics of
> the implementation. I guess the reason is that both resource_create and
> resource_update eventually call package_update and I wanted to avoid
> creating them two times, but perhaps the whole thing can be refactored so
> views are just created on package_update. The main thing would be to get
> the current resources before updating to know if new views need to be
> created on existing ones (if the format changed) but that should be doable.
> I'm happy to provide guidance if you want to submit a PR for this.
>
> Thanks,
>
> Adrià
>
> On Tue, 2 Oct 2018 at 21:54, Alex Gartner <
> alexandru.gartner+ckan at gmail.com> wrote:
>
>> Hi,
>>
>> I have noticed that resource views are not created when you do a
>> *package_update()*. The *package_update()* data might include a new
>> resource but that resource doesn't get a view.
>>
>> I looked through the code and it seems like the logic for creating
>> missing views ( *package_create_default_resource_views() /
>> resource_create_default_resource_views()* ) is only called for:
>>
>>    - *package_create()*
>>    - *resource_create()*
>>    - *resource_update() - *but just in case the format of the resource
>>    was changed
>>
>> We are on CKAN 2.7 but I think this holds true for 2.8 as well.
>>
>> I was thinking to override this behavior from a CKAN extension but wanted
>> to know whether there's some reason why this is not happening in the
>> default package_update().
>>
>> Thank you,
>> Alex
>> _______________________________________________
>> 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/20181026/28674942/attachment-0002.html>


More information about the ckan-dev mailing list