[ckan-dev] customizing model_save.package_dict_save()
Haq, Salman
Salman.Haq at neustar.biz
Wed Jun 27 19:22:40 UTC 2012
(Oops, accidentally hit send. Final email to follow – please ignore previous email).
From: <Haq>, Salman Haq <Salman.Haq at neustar.biz<mailto:Salman.Haq at neustar.biz>>
Reply-To: CKAN Development Discussions <ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>>
To: CKAN Development Discussions <ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>>
Subject: [ckan-dev] customizing model_save.package_dict_save()
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/d0f3a979/attachment-0001.html>
More information about the ckan-dev
mailing list