Skip to content
Snippets Groups Projects
Commit 48019173 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Deprecated methods replaced with their respective new versions from plugin interfaces

parent bcea53b6
No related branches found
No related tags found
1 merge request!50Upgraded to CKAN 2.10
......@@ -20,6 +20,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated minimum CKAN version requirement from `2.9` to `2.10`. Please run `ckan db upgrade` after updating.
- Replaced `is_okd_compliant` with `od_conformance` and `is_osi_compliant` with `osd_conformance` in the [licenses.json](./ckanext/odsh/resources/licenses.json) file.
- Deprecated methods replaced with their respective new versions from plugin interfaces:
- `ckan.plugins.interfaces.IResourceController`:
- Replaced `before_create` with `before_resource_create`
- Replaced `after_create` with `after_resource_create`
- Replaced `before_update` with `before_resource_update`
- Replaced `after_update` with `after_resource_update`
- Replaced `before_delete` with `before_resource_delete`
- Replaced `after_delete` with `after_resource_delete`
- Replaced `before_show` with `before_resource_show`
- `ckan.plugins.interfaces.IPackageController`:
- Replaced `after_create` with `after_dataset_create`
- Replaced `after_update` with `after_dataset_update`
- Replaced `after_delete` with `after_dataset_delete`
- Replaced `after_show` with `after_dataset_show`
- Replaced `before_search` with `before_dataset_search`
- Replaced `after_search` with `after_dataset_search`
- Replaced `before_index` with `before_dataset_index`
## [2.1.0]
......
......@@ -20,15 +20,15 @@ class ThumbnailPlugin(plugins.SingletonPlugin):
#IResourceController
def after_create(self, context, resource):
def after_resource_create(self, context, resource):
resources = thumbnail.resources_of_containing_package(resource)
thumbnail.create_thumbnail_if_none_in_package(context, resources)
def after_update(self, context, resource):
def after_resource_update(self, context, resource):
resources = thumbnail.resources_of_containing_package(resource)
thumbnail.create_thumbnail_if_none_in_package(context, resources)
def after_delete(self, context, resources):
def after_resource_delete(self, context, resources):
thumbnail.create_thumbnail_if_none_in_package(context, resources)
#IConfigurer
......
......@@ -252,7 +252,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
# IPackageController
def after_show(self, context, pkg_dict):
def after_dataset_show(self, context, pkg_dict):
'''
corrects missing relationships in pkg dict
adds the following key-value-pairs to pkg_dict:
......@@ -274,11 +274,11 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
self._update_is_new_in_pkg_dict(pkg_dict)
return pkg_dict
def after_create(self, context, resource):
def after_dataset_create(self, context, resource):
if resource.get('package_id'):
tools.add_attributes_resources(context, resource)
def after_update(self, context, resource):
def after_dataset_update(self, context, resource):
if resource.get('package_id'):
tools.add_attributes_resources(context, resource)
......@@ -287,7 +287,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
is_new = HelperPgkDict(pkg_dict).is_package_new()
pkg_dict.update({'is_new': is_new})
def before_index(self, dict_pkg):
def before_dataset_index(self, dict_pkg):
# make special date fields solr conform
fields = ["issued", "temporal_start", "temporal_end"]
for field in fields:
......
import ckanext.odsh.helpers as odsh_helpers
def before_search(search_params):
def before_dataset_search(search_params):
_update_facet_mincount(search_params)
_update_daterange_query(search_params)
return search_params
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment