[ckan-dev] IDomainObjectModification and resources
Toby Dacre
toby.okfn at gmail.com
Thu Jun 20 08:42:26 UTC 2013
On 19 June 2013 22:12, Ryan Clark <ryan.clark at azgs.az.gov> wrote:
> I would like to implement some custom functionality that occurs when
> resources are "deleted". We tried to use IDomainObjectModification to listen
> for such changes, but it looks like pushing the "Delete" button when editing
> a resource actually changes a ResourceRevision object, and
> IDomainObjectModification.notify is not called.
>
IDomainObjectModification does seem to be somewhat limited to datasets
The IMapper interface might do what you need. L personally have not
used it in anger
> - Does pushing that "delete" button call the action "resource_delete"? Are
> there any other side effects? Right now we are considering wrapping
> "resource_delete" in our own action, and then adjusting the UI to call that
> custom action.
you could consider extending the resource_delete action as is done
here for resource_show
https://github.com/okfn/ckan/blob/1c8ddf22cd80b61ad89456c912f5ea2c8ffa4eb6/ckanext/datastore/plugin.py#L74
and then add in via IActions interface this may well be the simplest approach
>
> - Its confusing to me that ALL domain objects hit the before_commit
> function, but then are filtered within that function. Notify on observing
> plugins is only called for a small set of modifications that meet the
> criteria defined in the before_commit function. Is there a reason that
> IDomainModification cannot be used to catch and analyze any and all
> modifications?
>
> Thank you!
> Ryan
>
> ____________________
>
> Ryan Clark
> Arizona Geological Survey
> ryan.clark at azgs.az.gov
> (520) 302-4871
> facebook.com/ModernGeologist
> @worbly
>
>
>
>
>
>
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
--
Toby Dacre
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/ | @okfn
More information about the ckan-dev
mailing list