{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/155","labels_url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/155/comments","events_url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/155/events","html_url":"https://github.com/ckan/ideas-and-roadmap/issues/155","id":99432631,"number":155,"title":"Allow plugins to tell datapusher what should and should not be pushed.","user":{"login":"rossjones","id":118063,"avatar_url":"https://avatars.githubusercontent.com/u/118063?v=3","gravatar_id":"","url":"https://api.github.com/users/rossjones","html_url":"https://github.com/rossjones","followers_url":"https://api.github.com/users/rossjones/followers","following_url":"https://api.github.com/users/rossjones/following{/other_user}","gists_url":"https://api.github.com/users/rossjones/gists{/gist_id}","starred_url":"https://api.github.com/users/rossjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossjones/subscriptions","organizations_url":"https://api.github.com/users/rossjones/orgs","repos_url":"https://api.github.com/users/rossjones/repos","events_url":"https://api.github.com/users/rossjones/events{/privacy}","received_events_url":"https://api.github.com/users/rossjones/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-06T13:21:55Z","updated_at":"2015-08-06T13:38:27Z","closed_at":null,"body":"I have a specific use-case where only resources with a specific extra should be pushed to the datapusher and then datastore.  Rather than sending *everything* to the datapusher service, I want more control over what is pushed from my own theme/plugin.\r\n\r\nIt would be neat if there was someway to register a callback in my plugin that the datapusher extension would check before doing the actual submission.  \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/comments/128368125","html_url":"https://github.com/ckan/ideas-and-roadmap/issues/155#issuecomment-128368125","issue_url":"https://api.github.com/repos/ckan/ideas-and-roadmap/issues/155","id":128368125,"user":{"login":"amercader","id":200230,"avatar_url":"https://avatars.githubusercontent.com/u/200230?v=3","gravatar_id":"","url":"https://api.github.com/users/amercader","html_url":"https://github.com/amercader","followers_url":"https://api.github.com/users/amercader/followers","following_url":"https://api.github.com/users/amercader/following{/other_user}","gists_url":"https://api.github.com/users/amercader/gists{/gist_id}","starred_url":"https://api.github.com/users/amercader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amercader/subscriptions","organizations_url":"https://api.github.com/users/amercader/orgs","repos_url":"https://api.github.com/users/amercader/repos","events_url":"https://api.github.com/users/amercader/events{/privacy}","received_events_url":"https://api.github.com/users/amercader/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T13:38:27Z","updated_at":"2015-08-06T13:38:27Z","body":"This sounds very reasonable. Something like an `IDataPusher.can_upload()` method.\r\n\r\nThis should probably be called [here](https://github.com/ckan/ckan/blob/cd843d6ea7e668907f6c51b9448c1fae368ab53b/ckanext/datapusher/plugin.py#L105), before calling `datapusher_submit`. Note that we don't have any dicts at this point, only the resource id. So we either pass the id to extensions or call `resource_show` / `package_show` and pass the dicts (I prefer the former, and let extensions handle this)\r\n\r\nAlso an `IDataPusher.after_upload()` method [here](https://github.com/ckan/ckan/blob/cd843d6ea7e668907f6c51b9448c1fae368ab53b/ckanext/datapusher/logic/action.py#L161) would be really useful, for instance to trigger further transformations on data uploaded to the DataStore."}}