[ckan-dev] customizing model_save.package_dict_save()

Haq, Salman Salman.Haq at neustar.biz
Wed Jun 27 19:20:51 UTC 2012


Hi,

My extension introduces new objects in the 'pkg_dict' obtained by parsing the POST params. I want to save these objects in a database table for which I have defined the ORM model similar to the 'resource' table.

The 'pkg_dict' is saved by the function model_save.package_dict_save(). There is no easy way to customize this function. Ideally, I just want to call a new function inside it similar to package_resource_list_save().

Possible options I am debating:

 1.  Introduce a interface for plugins that wish to implement this kind of behavior.
 2.  Rely on the existing IPackageController interface, but change the signature of IPackageController.edit so that it accepts the pkg_dict also and have my plugin implement that interface to perform my validation and save logic.
 3.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120627/90f113a6/attachment.html>


More information about the ckan-dev mailing list