datasette-surveys

Datasette plugin for creating surveys and collecting responses all in one place.


Keywords
alpaca, datasette, datasette-live, datasette-plugin
License
Apache-2.0
Install
pip install datasette-surveys==1.1.8

Documentation

datasette-surveys

Construct and gather responses to surveys all within Datasette!

Here's what the survey form builder looks like

This plugin is based heavily on the officially amazing but unsupported Alpaca form builder.

Installation

python setup.py install

Usage

The plugin adds an interface at /-/surveys and a "Surveys" link in the menu.

Configuration & Permissions

This plugin uses the permission plugin looking for responses to the following actions (they all start with surveys-):

  • surveys-list: allows actors to view the list of previously created surveys.
  • surveys-create: allows actors to create surveys. Won't allow overwriting by itself.
  • surveys-update: allows actors to update surveys, resource: id of the survey if being updated. This permission doesn't stop actors from updating with blank surveys or otherwise removing fields.
  • surveys-delete: allows actors to delete surveys. resource: id of the survey being deleted.
  • surveys-view-form: allows actors to view and respond to individual forms. resource: id of the survey.

One configuration option is available, which controls which directory the surveys folder will be placed.

# in your metadata.yml...
plugins:
  datasette-surveys:
    db_dir: /path/to/data

By default, the current working directory for the Datasette process will be used (assumed to be the same as the other DBs).

Development

The form builder borrows heavily from Alpaca's form builder and the front end build also comes from the Alpaca repo.

To pull the dependencies for the plugin, use bower:

bower install

And if you don't have bower, run this first: npm install -g bower

The form builder is found in datasette_surveys/static/form-builder.js. It's a modified version of the Alpaca one.

Running python setup.py install will reinstall the plugin.