[ckan-dev] new resource plugin trouble/suggestions

Tryggvi Björgvinsson tryggvi.bjorgvinsson at okfn.org
Wed Sep 17 12:59:38 UTC 2014


On mið 17.sep 2014 12:45, Adrià Mercader wrote:
> On 17 September 2014 13:25, Maurizio "Graffio" Mazzoneschi
> <graffio at lynxlab.com> wrote:
>> I've tried to use after_upload implementing IResourceUpload, but when
>> the server start (paster) this message is showed and the server do not
>> start:
>> p.implements(p.IResourceUpload)
>> AttributeError: 'module' object has no attribute 'IResourceUpload'
> It looks like this interface got lost at some point, I guess that
> during work on https://github.com/ckan/ckan/pull/1875
>
> @Sean, @Tryggvi can you clarify what happened? It looks to me that the
> after_upload method was missed all together, so not sure how the
> DataPackager will work:
>
> https://github.com/ckan/ckanext-datapackager/blob/master/ckanext/datapackager/plugin.py#L403

DataPackager runs on a special ckan branch: 
https://github.com/ckan/ckan/tree/datapackager which I used to base the 
IResourceController (then IResourceModification) on. I decided to 
generalize the plugin interfaces a little bit by removing special case 
interfaces (like IResourceUpload's after_upload and just go with 
after_create/after_update instead).

I did this in two different commits and tried to explain everything in 
the commit messages:
https://github.com/tryggvib/ckan/commit/4755cdd7e123bb53f30e76c804c7697a1fcff98b
https://github.com/tryggvib/ckan/commit/96b3b6388f683c080844d9a8e4d9c241dd107a3f

If DataPackager wants to run off of CKAN (what's currently been merged 
into master) instead of its own separate branch it will need to be 
updated to use after_create/after_upload and check the url_type.

Does this help?

/Tryggvi




More information about the ckan-dev mailing list