Skip to main content

Adding more structure to JSONFields

Project description

https://badge.fury.io/py/structjsonfield.svg https://travis-ci.org/tleguijt/structjsonfield.svg?branch=master https://codecov.io/gh/tleguijt/structjsonfield/branch/master/graph/badge.svg

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

History

0.1.4 (2017-06-20)

  • Added ability to disable specific columns

  • Added support for BooleanFields (checkboxes) as widget

0.1.3 (2017-06-15)

  • Fixed issue with disabled fields; given value is already JSON instead of a string

0.1.2 (2017-06-14)

  • Localized validation error messages

0.1.1 (2017-05-15)

  • Return unpacked rows as Columns to provide more context to the template

0.1.0 (2017-04-26)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structjsonfield-0.1.4.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

structjsonfield-0.1.4-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file structjsonfield-0.1.4.tar.gz.

File metadata

File hashes

Hashes for structjsonfield-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f6858df7e4cfeae5c10c738aea1f258328506eac6abfdf15a9a4562acaf1b1c3
MD5 013656ad72f1568858f3ed15d92fbd5f
BLAKE2b-256 d8eb4ab29d7f8311e4f4c6afff98637c0b362b262038478b6baf00e8ee4d55ba

See more details on using hashes here.

File details

Details for the file structjsonfield-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for structjsonfield-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e4ae80f652917622c55f0c5ea5d66e4b9e401c9cf29bc0f14f2a9d2c71667de1
MD5 15cf32e82cbc7f87fb138444203680c5
BLAKE2b-256 3fdb679c70665da9edc323e82033534c88fedd4fc8e5285af990002f445d0a34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page