datasette-checkbox by datasette

56 downloads this week        Star

README source code

datasette-checkbox

PyPI Changelog Tests License

Add interactive checkboxes to columns in Datasette. Requires Datasette 1.0 alpha or higher.

Animated demo showing checkboxes in columns for is_done, should_be_deleted and is_happy - checking the checkboxes shows an updated message next to each one which then fades away.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-checkbox

Usage

This plugin adds checkboxes to the table and row pages in Datasette for any column with a name that starts is_* or should_* or has_* and that is of type integer.

Toggling those checkboxes updates the underlying column to a 1 or a 0.

The checkbox interface will only be shown for users who have update-row permission for the table.

The easiest way to try this plugin is using the --root Datasette option:

datasette data.db --root

Or use the Datasette permission system to grant update-row to specific users.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-checkbox
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest