Django Flat JSON Key/Value Widget
Project description
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.8 and Django 3.2, 4.1 and 4.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
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
Built Distribution
File details
Details for the file django_flat_json_widget-0.3.1.tar.gz
.
File metadata
- Download URL: django_flat_json_widget-0.3.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b68fd8933efede6e86ba72f87e61dc35b35aeee4d6d001887a0f9046d616c8e |
|
MD5 | 3cce4ea3d28716e34c1ee6d19ca442c7 |
|
BLAKE2b-256 | fe86954a6c21ccbcdb68084b47f1b4cfc6505a1961d68008eeb7b4019ef766ac |
Provenance
The following attestation bundles were made for django_flat_json_widget-0.3.1.tar.gz
:
Publisher:
pypi.yml
on openwisp/django-flat-json-widget
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_flat_json_widget-0.3.1.tar.gz
- Subject digest:
2b68fd8933efede6e86ba72f87e61dc35b35aeee4d6d001887a0f9046d616c8e
- Sigstore transparency entry: 150023645
- Sigstore integration time:
- Predicate type:
File details
Details for the file django_flat_json_widget-0.3.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_flat_json_widget-0.3.1-py2.py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69ef04010196b0120bd9bc48feaa38bb2dbda608d2119f5e9aa46c0e18af2e54 |
|
MD5 | 9d2a077c0a89b3a93c167eaa80420d09 |
|
BLAKE2b-256 | 17bb15884c3ba2a1342f56ae0a2a852262380ab2099d2a36915675b3f680547f |
Provenance
The following attestation bundles were made for django_flat_json_widget-0.3.1-py2.py3-none-any.whl
:
Publisher:
pypi.yml
on openwisp/django-flat-json-widget
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_flat_json_widget-0.3.1-py2.py3-none-any.whl
- Subject digest:
69ef04010196b0120bd9bc48feaa38bb2dbda608d2119f5e9aa46c0e18af2e54
- Sigstore transparency entry: 150023646
- Sigstore integration time:
- Predicate type: