Skip to main content

mohawk-data-platform is a Django app for editing and publishing arbitrary JSON data in a form-based environment.

Features

  • Define structured models, with custom fields and validation.

  • Create, edit and update instances defined models using the Django admin interface.

  • Group models into applications for bulk access.

  • Access models, instances and applications via a simple JSON API.

  • Cross-origin API requests via CORS and JSONP.

Installation

  1. Checkout the latest mohawk-data-platform release and copy or symlink the data directory into your PYTHONPATH. If using pip, run pip install mohawk-data-platform.

  2. Add 'data' to your INSTALLED_APPS setting.

  3. Add url(r"^", include("data.urls", namespace="data")), to you urls.py file.

  4. Install and active the Django admin site, if not already present.

Admin usage

The bulk of the functionality for mohawk-data-platform is found within the admin UI. The basic workflow is:

  1. Create a Model, defining at least one Field.

  2. Create an Instance of that model.

  3. Optionally, create an Application.

  4. Edit the model, and add it to the application you created.

Any data you add to the system will be pubically-available via the API endpoints.

Model field reference

Fields added to a model take a number of optional config parameters, suppled as JSON documents. The available fields, and their configuration options, are listed below.

Fields which take choices expect them to be supplied as a list of [value, label] options:

{
    "choices": [
        ["#ff0000", "Red"],
        ["#0000ff", "Green"],
        ["#00ff00", "Blue"]
    ]
}

Text

A single-line of unicode text.

{
    "required": true,
    "choices": null
}

Integer

An integer number.

{
    "required": true,
    "choices": null
}

Float

A floating-point number.

{
    "required": true
}

Date

A date value.

{
    "required": true
}

Time

A time value.

{
    "required": true
}

Datetime

A combined date and time value.

{
    "required": true
}

Boolean

A true/false checkbox.

{}

File

An uploaded file.

{
    "required": true
}

Long text

Multiple lines of unicode text.

{
    "required": true
}

Model

A reference to an instance of a model.

{
    "required": true,
    "model_id": "<model_id>"  // The type of instance being referenced.
}

Multi model

A reference to multiple instances of a model.

{
    "required": true,
    "model_id": "<model_id>"  // The type of instance being referenced.
}

API endpoints

GET /<model_id>.json

Returns all online instances of the given model:

{
    "status": "OK",
    "message": "Instances of Your Model were successfully loaded.",
    "instances": [
        {
            "_date_created": "<timestamp>",
            "_date_modified": "<timestamp>",
            "_id": "<instance_id>",
            "_model": "<model_id>",
            "<field_name>": "<field_value>",
            ...
        },
        ...
    ]
}

GET /<model_id>/<instance_id>.json

Returns the given instance:

{
    "status": "OK",
    "message": "Instances of <model_name> were successfully loaded.",
    "instance": {
        "_date_created": "<timestamp>",
        "_date_modified": "<timestamp>",
        "_id": "<instance_id>",
        "_model": "<model_id>",
        "<field_name>": "<field_value>",
        ...
    }
}

GET /a/<application_id>.json

Returns all online instances within the given application:

{
    "status": "OK",
    "message": "Instances within application <application_name> were successfully loaded.",
    "instances": [
        {
            "_date_created": "<timestamp>",
            "_date_modified": "<timestamp>",
            "_id": "<instance_id>",
            "_model": "<model_id>",
            "<field_name>": "<field_value>",
            ...
        },
        ...
    ]
}

More information

The mohawk-data-platform project was developed at Mohawk, and is released as Open Source under the MIT license.

You can get the code from the mohawk-data-platform project site.

Contributors

The following people were involved in the development of this project.

Metadata

Release files for mohawk-data-platform 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mohawk-data-platform 0.9.3
File Size Uploaded
mohawk-data-platform-0.9.3.tar.gz 17.2 kB Details

Release files / mohawk-data-platform-0.9.3.tar.gz

Download URL mohawk-data-platform-0.9.3.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c4a8b130068f8237cb48e6bafef593e0bb3365c20be6de75c36d777e91d80242
BLAKE2b-256 checksum
How to use checksums
7b2cc0fe7b8a22e1a9482ffdbd23298b8951fe80c0f1d06f73c1e459bc2adfe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9.3 This release

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page