Django Structured JSONField
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