structjsonfield

Adding more structure to JSONFields


Keywords
structjsonfield
License
BSD-3-Clause
Install
pip install structjsonfield==0.1.4

Documentation

Django Structured JSONField

https://travis-ci.org/tleguijt/structjsonfield.svg?branch=master

Adding more structure to JSONFields

Documentation

The full documentation is at https://structjsonfield.readthedocs.io.

Quickstart

Install Django Structured JSONField:

pip install structjsonfield

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'structjsonfield',
    ...
)

Use the StructJSONField in your form

from structjsonfield import StructJSONField


ingredients = StructJSONField(
    structure={
        'name': forms.CharField(label=_('Name')),
        'amount': forms.CharField(label=_('Amount')),
        'units': forms.CharField(label=_('Units'))
    })

Prerequisites

  • Make sure you have jQuery loaded in your template
  • Make sure you load the necessary form media (js + css)

Features

  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox