If you ever needed to store a flexible dictionary of keys and values in your django models, you may have felt the need of giving your users a widget to easily manipulate the data by adding or removing rows, instead of having to edit the raw JSON.
This package solves exactly that problem: it offers a widget to manipulate a flat JSON object made of simple keys and values.
Compatibility
Tested on python >= 3.10 and Django 4.2, 5.1 and 5.2.
It should work also on previous versions of Django.
Install stable version from pypi
Install from pypi:
pip install django-flat-json-widget
Usage
Add flat_json_widget to INSTALLED_APPS:
INSTALLED_APPS = [
# other apps...
"flat_json_widget",
]
Then load the widget where you need it, for example, here’s how to use it in the django admin site:
from django.contrib import admin
from django import forms
from .models import JsonDocument
from flat_json_widget.widgets import FlatJsonWidget
class JsonDocumentForm(forms.ModelForm):
class Meta:
widgets = {"content": FlatJsonWidget}
@admin.register(JsonDocument)
class JsonDocumentAdmin(admin.ModelAdmin):
list_display = ["name"]
form = JsonDocumentForm
Installing for development
Install your forked repo:
git clone git://github.com/<your_fork>/django-flat-json-widget
cd django-flat-json-widget/
python setup.py develop
Install development dependencies:
pip install -e .[test]
npm install -g jslint jshint stylelint
Create database:
cd tests/
./manage.py migrate
./manage.py createsuperuser
Launch development server:
./manage.py runserver 0.0.0.0:8000
You can access the admin interface at http://127.0.0.1:8000/admin/.
Run tests with:
./runtests.py
Run quality assurance tests with:
./run-qa-checks
Contributing
Please refer to the OpenWISP contributing guidelines.
Changelog
See CHANGES.
License
See LICENSE.
Support
Metadata
Release files for django-flat-json-widget 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_flat_json_widget-0.5.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_flat_json_widget-0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 34.8 kB
Release files / django_flat_json_widget-0.5.tar.gz
| Download URL | django_flat_json_widget-0.5.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ff155d313b0f1d4a3ecc542247f68690165f6aeb4a517e0b66d36660b14be7a
|
|
BLAKE2b-256 checksum How to use checksums |
3ce6fce1892710dfb5f0a4a31e869575708a4ac0ab81b6269e3372144aca664c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / django_flat_json_widget-0.5-py2.py3-none-any.whl
| Download URL | django_flat_json_widget-0.5-py2.py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
fa1ca27efc7a9c3eb5907d0eee506c0e6215a06800182589c5a95963b839334d
|
|
BLAKE2b-256 checksum How to use checksums |
8af50b32d37026bfed4b251514f0a012748fe0a36ee610d67270a3652e982450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log