Add further notes on extending ckan harvester
This commit is contained in:
parent
30f19713fa
commit
819706ae5d
16
README.rst
16
README.rst
|
@ -437,7 +437,7 @@ This is a simple example::
|
|||
|
||||
from ckanext.harvester.harvesters.ckanharvester import CKANHarvester
|
||||
|
||||
class MyCustomCKANHarvester(CKANHarvester):
|
||||
class MySiteCKANHarvester(CKANHarvester):
|
||||
|
||||
def modify_package_dict(self, package_dict, harvest_object):
|
||||
|
||||
|
@ -450,6 +450,20 @@ This is a simple example::
|
|||
|
||||
return package_dict
|
||||
|
||||
Remember to register your custom harvester plugin in your extension ``setup.py`` file, and load the plugin in the config in file afterwards::
|
||||
|
||||
# setup.py
|
||||
|
||||
entry_points='''
|
||||
[ckan.plugins]
|
||||
my_site=ckanext.my_site.plugin:MySitePlugin
|
||||
my_site_ckan_harvester=ckanext.my_site.harvesters:MySiteCKANHarvester
|
||||
'''
|
||||
|
||||
|
||||
# ini file
|
||||
ckan.plugins = ... my_site my_site_ckan_harvester
|
||||
|
||||
|
||||
The harvesting interface
|
||||
========================
|
||||
|
|
Loading…
Reference in New Issue