Target release0.0.1
Source (e.g. Github)https://github.com/open-data/ckanext-repeating
Main featuresThis extension provides a way to store repeating fields in CKAN datasets, resources, organizations and groups.
Prerequisite / Dependencies

the easiest way is to use it together with ckanext-scheming

LicenseMIT
Installed by
Document status

COMPLETED

Background and strategic fit

Add the repeating plugin to your ckan.plugins configuration settings and use ckanext-scheming or a custom form plugin to use the provided validators to store repeating values in metadata fields.

This for example is required for the author or maintainer of a resource entry where we might have more than one person responsible for.

Installations and Requirements

To install ckanext-repeating on a production site:

  1. Activate your CKAN virtual environment, for example:

    ENV /usr/lib/ckan/default/bin/activate
  2. Install the ckanext-repeating Python package into your virtual environment:

    pip install ckanext-repeating
    
    // or
    
    pip install -e git+https://github.com/open-data/ckanext-repeating#egg=ckanext-repeating
  3. Add the relevant plugins to the ckan.plugins setting in your CKAN config file.

  4. Add ckanext.repeating:presets.json to your scheming. presets configuration settings:

    scheming.presets = ckanext.scheming:presets.json
                       ckanext.repeating:presets.json
  5. Restart CKAN. For example, if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload

User interaction and design

A repeating field in a scheming schema will look something like:

{
  "field_name": "authors",
  "preset": "repeating_text",
  "label": "Author",
  "form_blanks": 3
}

This new extra field "authors" will appear as multiple fields in the dataset form, with three blank values below existing values. by the [form snippet](ckanext/repeating/templates/scheming/form_snippets/repeating_text.html).

When displayed, each value for the text entered will appear separately by the [display snippet](ckanext/repeating/templates/scheming/display_snippets/repeating_text.html), eg.:

repeating-display.png

When the dataset is accessed from the API each value will appear and are updated as items in a list, eg.:

{
  "...": "...",
  "authors": [
    "Person One",
    "Person Two"
  ],
  "...": "..."
}

Questions and Answers

Below is a list of Q&A from user sides:

QuestionAnswers

Further steps