ckanext-esdstandards
Helpers for working with LGA’s ESD standards on CKAN.
This extension contains:
- Action functions for autocomplete lookup for ESD Functions and Services
- Form widgets and validators for easily integrate ESD Functions and Services fields into custom schemas (adding the
la_function and la_service fields, supported when harvesting datasets into data.gov.uk)
- Snippets for rendering the ESD Functions and Services on the dataset page
Installation
To install ckanext-esdstandards:
Activate your CKAN virtual environment:
source /usr/lib/ckan/default/bin/activate
Install the ckanext-esdstandards Python package:
pip install ckanext-esdstandards
Add esd to the ckan.plugins setting in your CKAN config file.
Restart CKAN.
Integrating on Your Own Extension
This extension will not add anything by default to your CKAN instance (apart from some helper actions and functions). You need to modify the schema and templates on your project extension to add the fields and widgets.
Adding Fields to Custom Schema
You will need to extend the default CKAN schema using the IDatasetForm interface. The extension provides validators:
- esd_function_validator
- esd_service_validator
The fields should be stored as extras named la_function and la_service (as per Appendix B of the data.gov.uk harvesting guide).
Adding Form Widgets
Extend the package_basic_fields.html template with the provided snippets:
- snippets/esd_functions.html
- snippets/esd_services.html
Displaying Field Values
Extend the additional_info.html template with:
- snippets/esd_functions_additional_info.html
- snippets/esd_services_additional_info.html
Development Installation
git clone https://github.com/okfn/ckanext-esdstandards.git
cd ckanext-esdstandards
python setup.py develop
License
Available on PyPI as ckanext-esdstandards