[ckan-dev] new resource plugin trouble/suggestions

Maurizio "Graffio" Mazzoneschi graffio at lynxlab.com
Wed Sep 17 12:25:48 UTC 2014


Hi,
I add some info, so someone can suggest to me some workaround.

I have installed from source the latest version from github.

I think the better way for me could be to implement the after_upload
method, but it seems do not works. Nevertheless I've find some
extensions that use it.
For instance:
https://github.com/ckan/ckanext-datapackager/blob/master/ckanext/datapackager/plugin.py

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'

Any suggestion is welcome
thanks in advance
m


Il 16/09/2014 18:05, Maurizio "Graffio" Mazzoneschi ha scritto:
> Hello all,
> I'm writing a plugin to modify the behaviour of "add resource" function,
> in order to apply some transformation to the uploaded file.
>
> I'm having some trouble. Any help is welcome!
>
> I've used  get_actions and logic.get_action('resource_create')(context,
> data_dict)
>
> but ckan give back this error message:
> RuntimeError: maximum recursion depth exceeded
>
> I've tried also to use after_upload method , but CKAN seems ignore the
> method
>
> Someone can help me?
>  
>
> This is my code:
>
>     def get_actions(self):
>         return {
>             'resource_create': resource_create_FN
>         } 
>
> def resource_create_FN(context, data_dict):
>     #do somethings
>     return logic.get_action('resource_create')(context, data_dict)
>


-- 
maurizio "graffio" mazzoneschi
Lynx s.r.l.
http://www.lynxlab.com
http://www.scoop.it/t/graffio
skype: graffio_m





More information about the ckan-dev mailing list