.. image:: https://travis-ci.org/aptivate/ckanext-datasetversions.svg?branch=v1.0.2
:target: https://travis-ci.org/aptivate/ckanext-datasetversions
=======================
ckanext-datasetversions
This CKAN extension adds support for different versions of a dataset. Sometimes
is is desirable to store and display together different versions of a dataset,
for example a daily situation report-style map during a humanitarian crisis.
This plugin provides an action dataset_version_create, for example::
toolkit.get_action('dataset_version_create')(
context, {
'id': dataset['id'],
'base_name': base_name,
'owner_org': owner_org
}
)
The plugin models dataset versions internally by creating a parent dataset, with
minimal metadata and no resources. A child dataset is created for each version.
dataset_version_create will create a parent-child relationship between the
dataset specified by base_name and that specified by id. If the dataset
specified by base_name does not exist, it will be created.
Note that this plugin overrides CKAN’s package_show action. The original
package_show is made available as ckan_package_show.
For datasets with different versions, the overridden package_show will
return:
- The latest, public, active version of the dataset if the parent name or id is specified
- A specific version of the dataset if the child name or id is specified
The version ordering is determined by the integer value of version in the
dataset metadata.
In addition, package_show will return a list of the names and URLs of all
active versions as _versions in the dictionary.
The plugin provides templates to list versions of a dataset alongside that
currently viewed and to warn the user if they are looking at an old version of a
dataset.
Requirements
This plugin will not work ‘out of the box’. You will need to write co