django-flat-json-widget 0.2__tar.gz → 0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/CHANGES.rst +15 -2
- {django-flat-json-widget-0.2/django_flat_json_widget.egg-info → django_flat_json_widget-0.3}/PKG-INFO +43 -42
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/README.rst +35 -34
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3/django_flat_json_widget.egg-info}/PKG-INFO +43 -42
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/django_flat_json_widget.egg-info/SOURCES.txt +1 -0
- django_flat_json_widget-0.3/django_flat_json_widget.egg-info/requires.txt +4 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/__init__.py +1 -1
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/widgets.py +1 -3
- django_flat_json_widget-0.3/pyproject.toml +16 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/setup.py +5 -21
- django-flat-json-widget-0.2/django_flat_json_widget.egg-info/requires.txt +0 -4
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/LICENSE +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/MANIFEST.in +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/django_flat_json_widget.egg-info/dependency_links.txt +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/django_flat_json_widget.egg-info/not-zip-safe +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/django_flat_json_widget.egg-info/top_level.txt +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/static/flat-json-widget/css/flat-json-widget.css +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/static/flat-json-widget/js/flat-json-widget.js +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/static/flat-json-widget/js/lib/underscore.js +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/templates/flat_json_widget/flat_json_widget.html +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/flat_json_widget/tests.py +0 -0
- {django-flat-json-widget-0.2 → django_flat_json_widget-0.3}/setup.cfg +0 -0
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
Version 0.3.0 [2024-08-23]
|
|
5
|
+
--------------------------
|
|
6
|
+
|
|
7
|
+
Changes
|
|
8
|
+
~~~~~~~
|
|
9
|
+
|
|
10
|
+
**Dependencies:**
|
|
11
|
+
|
|
12
|
+
- Added support for Python ``3.10``.
|
|
13
|
+
- Dropped support for Python ``3.7``.
|
|
14
|
+
- Added support for Django ``4.2``.
|
|
15
|
+
- Dropped support for Django ``3.1.x`` and ``4.0.x``.
|
|
16
|
+
|
|
4
17
|
Version 0.2.0 [2022-03-19]
|
|
5
18
|
--------------------------
|
|
6
19
|
|
|
@@ -13,8 +26,8 @@ Changes
|
|
|
13
26
|
Version 0.1.3 [2021-07-20]
|
|
14
27
|
--------------------------
|
|
15
28
|
|
|
16
|
-
- [fix] Added jquery.init.js in the widget media to fix
|
|
17
|
-
|
|
29
|
+
- [fix] Added jquery.init.js in the widget media to fix `django.jQuery` JS
|
|
30
|
+
error
|
|
18
31
|
|
|
19
32
|
Version 0.1.2 [2020-12-05]
|
|
20
33
|
--------------------------
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-flat-json-widget
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3
|
|
4
4
|
Summary: Django Flat JSON Key/Value Widget
|
|
5
5
|
Home-page: https://github.com/openwisp/django-flat-json-widget
|
|
6
|
-
Author: Federico Capoano
|
|
7
|
-
Author-email: federico.capoano@gmail.com
|
|
8
|
-
License: BSD-3-Clause
|
|
9
6
|
Download-URL: https://github.com/openwisp/django-flat-json-widget/releases
|
|
7
|
+
Author: OpenWISP
|
|
8
|
+
Author-email: support@openwisp.io
|
|
9
|
+
License: BSD-3-Clause
|
|
10
10
|
Keywords: django,json,key-value,widget
|
|
11
11
|
Platform: Platform Independent
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Environment :: Web Environment
|
|
14
14
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -17,58 +17,60 @@ Classifier: License :: OSI Approved :: BSD License
|
|
|
17
17
|
Classifier: Operating System :: OS Independent
|
|
18
18
|
Classifier: Framework :: Django
|
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Provides-Extra: test
|
|
21
20
|
License-File: LICENSE
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: openwisp-utils[qa]~=1.1.0; extra == "test"
|
|
23
|
+
Requires-Dist: django-extensions~=3.2.0; extra == "test"
|
|
22
24
|
|
|
23
25
|
django-flat-json-widget
|
|
24
26
|
=======================
|
|
25
27
|
|
|
26
28
|
.. image:: https://github.com/openwisp/django-flat-json-widget/workflows/Django%20Flat%20JSON%20Widget%20CI%20Build/badge.svg?branch=master
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
:target: https://github.com/openwisp/openwisp-controller/actions?query=workflow%3A%22Django%20Flat%20JSON%20Widget%20CI%20Build%22
|
|
30
|
+
:alt: CI build status
|
|
29
31
|
|
|
30
32
|
.. image:: https://coveralls.io/repos/openwisp/django-flat-json-widget/badge.svg
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
:target: https://coveralls.io/r/openwisp/django-flat-json-widget
|
|
34
|
+
:alt: Test Coverage
|
|
33
35
|
|
|
34
36
|
.. image:: https://img.shields.io/librariesio/release/github/openwisp/django-flat-json-widget
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
:target: https://libraries.io/github/openwisp/django-flat-json-widget#repository_dependencies
|
|
38
|
+
:alt: Dependency monitoring
|
|
37
39
|
|
|
38
40
|
.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
:target: https://gitter.im/openwisp/general
|
|
42
|
+
:alt: Chat
|
|
41
43
|
|
|
42
44
|
.. image:: https://badge.fury.io/py/django-flat-json-widget.svg
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
:target: http://badge.fury.io/py/django-flat-json-widget
|
|
46
|
+
:alt: Pypi Version
|
|
45
47
|
|
|
46
48
|
.. image:: https://pepy.tech/badge/django-flat-json-widget
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
:target: https://pepy.tech/project/django-flat-json-widget
|
|
50
|
+
:alt: Downloads
|
|
49
51
|
|
|
50
52
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
:target: https://pypi.org/project/black/
|
|
54
|
+
:alt: code style: black
|
|
53
55
|
|
|
54
56
|
.. image:: https://raw.githubusercontent.com/openwisp/django-flat-json-widget/master/docs/django-flat-json-widget-demo.gif
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
:target: https://github.com/openwisp/django-flat-json-widget/tree/master/docs/django-flat-json-widget-demo.gif
|
|
58
|
+
:alt: Django Flat JSON (key/value) Widget
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
----
|
|
59
61
|
|
|
60
|
-
If you ever needed to store a flexible dictionary of keys and values in
|
|
61
|
-
django models, you may have felt the need of giving your users a
|
|
62
|
-
easily manipulate the data by adding or removing rows,
|
|
63
|
-
|
|
62
|
+
If you ever needed to store a flexible dictionary of keys and values in
|
|
63
|
+
your django models, you may have felt the need of giving your users a
|
|
64
|
+
widget to easily manipulate the data by adding or removing rows, instead
|
|
65
|
+
of having to edit the raw JSON.
|
|
64
66
|
|
|
65
|
-
This package solves exactly that problem: **it offers a widget to
|
|
66
|
-
a flat JSON object made of simple keys and values**.
|
|
67
|
+
This package solves exactly that problem: **it offers a widget to
|
|
68
|
+
manipulate a flat JSON object made of simple keys and values**.
|
|
67
69
|
|
|
68
70
|
Compatibility
|
|
69
71
|
-------------
|
|
70
72
|
|
|
71
|
-
Tested on python >= 3.
|
|
73
|
+
Tested on python >= 3.8 and Django 3.2, 4.1 and 4.2.
|
|
72
74
|
|
|
73
75
|
It should work also on previous versions of Django.
|
|
74
76
|
|
|
@@ -90,11 +92,11 @@ Add ``flat_json_widget`` to ``INSTALLED_APPS``:
|
|
|
90
92
|
|
|
91
93
|
INSTALLED_APPS = [
|
|
92
94
|
# other apps...
|
|
93
|
-
|
|
95
|
+
"flat_json_widget",
|
|
94
96
|
]
|
|
95
97
|
|
|
96
|
-
Then load the widget where you need it, for example, here's how to use it
|
|
97
|
-
django admin site:
|
|
98
|
+
Then load the widget where you need it, for example, here's how to use it
|
|
99
|
+
in the django admin site:
|
|
98
100
|
|
|
99
101
|
.. code-block:: python
|
|
100
102
|
|
|
@@ -107,14 +109,12 @@ django admin site:
|
|
|
107
109
|
|
|
108
110
|
class JsonDocumentForm(forms.ModelForm):
|
|
109
111
|
class Meta:
|
|
110
|
-
widgets = {
|
|
111
|
-
'content': FlatJsonWidget
|
|
112
|
-
}
|
|
112
|
+
widgets = {"content": FlatJsonWidget}
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
@admin.register(JsonDocument)
|
|
116
116
|
class JsonDocumentAdmin(admin.ModelAdmin):
|
|
117
|
-
list_display = [
|
|
117
|
+
list_display = ["name"]
|
|
118
118
|
form = JsonDocumentForm
|
|
119
119
|
|
|
120
120
|
Installing for development
|
|
@@ -166,21 +166,22 @@ Run quality assurance tests with:
|
|
|
166
166
|
Contributing
|
|
167
167
|
------------
|
|
168
168
|
|
|
169
|
-
Please refer to the `OpenWISP contributing guidelines
|
|
169
|
+
Please refer to the `OpenWISP contributing guidelines
|
|
170
|
+
<http://openwisp.io/docs/developer/contributing.html>`_.
|
|
170
171
|
|
|
171
172
|
Changelog
|
|
172
173
|
---------
|
|
173
174
|
|
|
174
|
-
See `CHANGES
|
|
175
|
+
See `CHANGES
|
|
176
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/CHANGES.rst>`_.
|
|
175
177
|
|
|
176
178
|
License
|
|
177
179
|
-------
|
|
178
180
|
|
|
179
|
-
See `LICENSE
|
|
181
|
+
See `LICENSE
|
|
182
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/LICENSE>`_.
|
|
180
183
|
|
|
181
184
|
Support
|
|
182
185
|
-------
|
|
183
186
|
|
|
184
187
|
See `OpenWISP Support Channels <http://openwisp.org/support.html>`_.
|
|
185
|
-
|
|
186
|
-
|
|
@@ -2,51 +2,51 @@ django-flat-json-widget
|
|
|
2
2
|
=======================
|
|
3
3
|
|
|
4
4
|
.. image:: https://github.com/openwisp/django-flat-json-widget/workflows/Django%20Flat%20JSON%20Widget%20CI%20Build/badge.svg?branch=master
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
:target: https://github.com/openwisp/openwisp-controller/actions?query=workflow%3A%22Django%20Flat%20JSON%20Widget%20CI%20Build%22
|
|
6
|
+
:alt: CI build status
|
|
7
7
|
|
|
8
8
|
.. image:: https://coveralls.io/repos/openwisp/django-flat-json-widget/badge.svg
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
:target: https://coveralls.io/r/openwisp/django-flat-json-widget
|
|
10
|
+
:alt: Test Coverage
|
|
11
11
|
|
|
12
12
|
.. image:: https://img.shields.io/librariesio/release/github/openwisp/django-flat-json-widget
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
:target: https://libraries.io/github/openwisp/django-flat-json-widget#repository_dependencies
|
|
14
|
+
:alt: Dependency monitoring
|
|
15
15
|
|
|
16
16
|
.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
:target: https://gitter.im/openwisp/general
|
|
18
|
+
:alt: Chat
|
|
19
19
|
|
|
20
20
|
.. image:: https://badge.fury.io/py/django-flat-json-widget.svg
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
:target: http://badge.fury.io/py/django-flat-json-widget
|
|
22
|
+
:alt: Pypi Version
|
|
23
23
|
|
|
24
24
|
.. image:: https://pepy.tech/badge/django-flat-json-widget
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
:target: https://pepy.tech/project/django-flat-json-widget
|
|
26
|
+
:alt: Downloads
|
|
27
27
|
|
|
28
28
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
:target: https://pypi.org/project/black/
|
|
30
|
+
:alt: code style: black
|
|
31
31
|
|
|
32
32
|
.. image:: https://raw.githubusercontent.com/openwisp/django-flat-json-widget/master/docs/django-flat-json-widget-demo.gif
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
:target: https://github.com/openwisp/django-flat-json-widget/tree/master/docs/django-flat-json-widget-demo.gif
|
|
34
|
+
:alt: Django Flat JSON (key/value) Widget
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
----
|
|
37
37
|
|
|
38
|
-
If you ever needed to store a flexible dictionary of keys and values in
|
|
39
|
-
django models, you may have felt the need of giving your users a
|
|
40
|
-
easily manipulate the data by adding or removing rows,
|
|
41
|
-
|
|
38
|
+
If you ever needed to store a flexible dictionary of keys and values in
|
|
39
|
+
your django models, you may have felt the need of giving your users a
|
|
40
|
+
widget to easily manipulate the data by adding or removing rows, instead
|
|
41
|
+
of having to edit the raw JSON.
|
|
42
42
|
|
|
43
|
-
This package solves exactly that problem: **it offers a widget to
|
|
44
|
-
a flat JSON object made of simple keys and values**.
|
|
43
|
+
This package solves exactly that problem: **it offers a widget to
|
|
44
|
+
manipulate a flat JSON object made of simple keys and values**.
|
|
45
45
|
|
|
46
46
|
Compatibility
|
|
47
47
|
-------------
|
|
48
48
|
|
|
49
|
-
Tested on python >= 3.
|
|
49
|
+
Tested on python >= 3.8 and Django 3.2, 4.1 and 4.2.
|
|
50
50
|
|
|
51
51
|
It should work also on previous versions of Django.
|
|
52
52
|
|
|
@@ -68,11 +68,11 @@ Add ``flat_json_widget`` to ``INSTALLED_APPS``:
|
|
|
68
68
|
|
|
69
69
|
INSTALLED_APPS = [
|
|
70
70
|
# other apps...
|
|
71
|
-
|
|
71
|
+
"flat_json_widget",
|
|
72
72
|
]
|
|
73
73
|
|
|
74
|
-
Then load the widget where you need it, for example, here's how to use it
|
|
75
|
-
django admin site:
|
|
74
|
+
Then load the widget where you need it, for example, here's how to use it
|
|
75
|
+
in the django admin site:
|
|
76
76
|
|
|
77
77
|
.. code-block:: python
|
|
78
78
|
|
|
@@ -85,14 +85,12 @@ django admin site:
|
|
|
85
85
|
|
|
86
86
|
class JsonDocumentForm(forms.ModelForm):
|
|
87
87
|
class Meta:
|
|
88
|
-
widgets = {
|
|
89
|
-
'content': FlatJsonWidget
|
|
90
|
-
}
|
|
88
|
+
widgets = {"content": FlatJsonWidget}
|
|
91
89
|
|
|
92
90
|
|
|
93
91
|
@admin.register(JsonDocument)
|
|
94
92
|
class JsonDocumentAdmin(admin.ModelAdmin):
|
|
95
|
-
list_display = [
|
|
93
|
+
list_display = ["name"]
|
|
96
94
|
form = JsonDocumentForm
|
|
97
95
|
|
|
98
96
|
Installing for development
|
|
@@ -144,17 +142,20 @@ Run quality assurance tests with:
|
|
|
144
142
|
Contributing
|
|
145
143
|
------------
|
|
146
144
|
|
|
147
|
-
Please refer to the `OpenWISP contributing guidelines
|
|
145
|
+
Please refer to the `OpenWISP contributing guidelines
|
|
146
|
+
<http://openwisp.io/docs/developer/contributing.html>`_.
|
|
148
147
|
|
|
149
148
|
Changelog
|
|
150
149
|
---------
|
|
151
150
|
|
|
152
|
-
See `CHANGES
|
|
151
|
+
See `CHANGES
|
|
152
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/CHANGES.rst>`_.
|
|
153
153
|
|
|
154
154
|
License
|
|
155
155
|
-------
|
|
156
156
|
|
|
157
|
-
See `LICENSE
|
|
157
|
+
See `LICENSE
|
|
158
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/LICENSE>`_.
|
|
158
159
|
|
|
159
160
|
Support
|
|
160
161
|
-------
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-flat-json-widget
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3
|
|
4
4
|
Summary: Django Flat JSON Key/Value Widget
|
|
5
5
|
Home-page: https://github.com/openwisp/django-flat-json-widget
|
|
6
|
-
Author: Federico Capoano
|
|
7
|
-
Author-email: federico.capoano@gmail.com
|
|
8
|
-
License: BSD-3-Clause
|
|
9
6
|
Download-URL: https://github.com/openwisp/django-flat-json-widget/releases
|
|
7
|
+
Author: OpenWISP
|
|
8
|
+
Author-email: support@openwisp.io
|
|
9
|
+
License: BSD-3-Clause
|
|
10
10
|
Keywords: django,json,key-value,widget
|
|
11
11
|
Platform: Platform Independent
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Environment :: Web Environment
|
|
14
14
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -17,58 +17,60 @@ Classifier: License :: OSI Approved :: BSD License
|
|
|
17
17
|
Classifier: Operating System :: OS Independent
|
|
18
18
|
Classifier: Framework :: Django
|
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Provides-Extra: test
|
|
21
20
|
License-File: LICENSE
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: openwisp-utils[qa]~=1.1.0; extra == "test"
|
|
23
|
+
Requires-Dist: django-extensions~=3.2.0; extra == "test"
|
|
22
24
|
|
|
23
25
|
django-flat-json-widget
|
|
24
26
|
=======================
|
|
25
27
|
|
|
26
28
|
.. image:: https://github.com/openwisp/django-flat-json-widget/workflows/Django%20Flat%20JSON%20Widget%20CI%20Build/badge.svg?branch=master
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
:target: https://github.com/openwisp/openwisp-controller/actions?query=workflow%3A%22Django%20Flat%20JSON%20Widget%20CI%20Build%22
|
|
30
|
+
:alt: CI build status
|
|
29
31
|
|
|
30
32
|
.. image:: https://coveralls.io/repos/openwisp/django-flat-json-widget/badge.svg
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
:target: https://coveralls.io/r/openwisp/django-flat-json-widget
|
|
34
|
+
:alt: Test Coverage
|
|
33
35
|
|
|
34
36
|
.. image:: https://img.shields.io/librariesio/release/github/openwisp/django-flat-json-widget
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
:target: https://libraries.io/github/openwisp/django-flat-json-widget#repository_dependencies
|
|
38
|
+
:alt: Dependency monitoring
|
|
37
39
|
|
|
38
40
|
.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
:target: https://gitter.im/openwisp/general
|
|
42
|
+
:alt: Chat
|
|
41
43
|
|
|
42
44
|
.. image:: https://badge.fury.io/py/django-flat-json-widget.svg
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
:target: http://badge.fury.io/py/django-flat-json-widget
|
|
46
|
+
:alt: Pypi Version
|
|
45
47
|
|
|
46
48
|
.. image:: https://pepy.tech/badge/django-flat-json-widget
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
:target: https://pepy.tech/project/django-flat-json-widget
|
|
50
|
+
:alt: Downloads
|
|
49
51
|
|
|
50
52
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
:target: https://pypi.org/project/black/
|
|
54
|
+
:alt: code style: black
|
|
53
55
|
|
|
54
56
|
.. image:: https://raw.githubusercontent.com/openwisp/django-flat-json-widget/master/docs/django-flat-json-widget-demo.gif
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
:target: https://github.com/openwisp/django-flat-json-widget/tree/master/docs/django-flat-json-widget-demo.gif
|
|
58
|
+
:alt: Django Flat JSON (key/value) Widget
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
----
|
|
59
61
|
|
|
60
|
-
If you ever needed to store a flexible dictionary of keys and values in
|
|
61
|
-
django models, you may have felt the need of giving your users a
|
|
62
|
-
easily manipulate the data by adding or removing rows,
|
|
63
|
-
|
|
62
|
+
If you ever needed to store a flexible dictionary of keys and values in
|
|
63
|
+
your django models, you may have felt the need of giving your users a
|
|
64
|
+
widget to easily manipulate the data by adding or removing rows, instead
|
|
65
|
+
of having to edit the raw JSON.
|
|
64
66
|
|
|
65
|
-
This package solves exactly that problem: **it offers a widget to
|
|
66
|
-
a flat JSON object made of simple keys and values**.
|
|
67
|
+
This package solves exactly that problem: **it offers a widget to
|
|
68
|
+
manipulate a flat JSON object made of simple keys and values**.
|
|
67
69
|
|
|
68
70
|
Compatibility
|
|
69
71
|
-------------
|
|
70
72
|
|
|
71
|
-
Tested on python >= 3.
|
|
73
|
+
Tested on python >= 3.8 and Django 3.2, 4.1 and 4.2.
|
|
72
74
|
|
|
73
75
|
It should work also on previous versions of Django.
|
|
74
76
|
|
|
@@ -90,11 +92,11 @@ Add ``flat_json_widget`` to ``INSTALLED_APPS``:
|
|
|
90
92
|
|
|
91
93
|
INSTALLED_APPS = [
|
|
92
94
|
# other apps...
|
|
93
|
-
|
|
95
|
+
"flat_json_widget",
|
|
94
96
|
]
|
|
95
97
|
|
|
96
|
-
Then load the widget where you need it, for example, here's how to use it
|
|
97
|
-
django admin site:
|
|
98
|
+
Then load the widget where you need it, for example, here's how to use it
|
|
99
|
+
in the django admin site:
|
|
98
100
|
|
|
99
101
|
.. code-block:: python
|
|
100
102
|
|
|
@@ -107,14 +109,12 @@ django admin site:
|
|
|
107
109
|
|
|
108
110
|
class JsonDocumentForm(forms.ModelForm):
|
|
109
111
|
class Meta:
|
|
110
|
-
widgets = {
|
|
111
|
-
'content': FlatJsonWidget
|
|
112
|
-
}
|
|
112
|
+
widgets = {"content": FlatJsonWidget}
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
@admin.register(JsonDocument)
|
|
116
116
|
class JsonDocumentAdmin(admin.ModelAdmin):
|
|
117
|
-
list_display = [
|
|
117
|
+
list_display = ["name"]
|
|
118
118
|
form = JsonDocumentForm
|
|
119
119
|
|
|
120
120
|
Installing for development
|
|
@@ -166,21 +166,22 @@ Run quality assurance tests with:
|
|
|
166
166
|
Contributing
|
|
167
167
|
------------
|
|
168
168
|
|
|
169
|
-
Please refer to the `OpenWISP contributing guidelines
|
|
169
|
+
Please refer to the `OpenWISP contributing guidelines
|
|
170
|
+
<http://openwisp.io/docs/developer/contributing.html>`_.
|
|
170
171
|
|
|
171
172
|
Changelog
|
|
172
173
|
---------
|
|
173
174
|
|
|
174
|
-
See `CHANGES
|
|
175
|
+
See `CHANGES
|
|
176
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/CHANGES.rst>`_.
|
|
175
177
|
|
|
176
178
|
License
|
|
177
179
|
-------
|
|
178
180
|
|
|
179
|
-
See `LICENSE
|
|
181
|
+
See `LICENSE
|
|
182
|
+
<https://github.com/openwisp/django-flat-json-widget/blob/master/LICENSE>`_.
|
|
180
183
|
|
|
181
184
|
Support
|
|
182
185
|
-------
|
|
183
186
|
|
|
184
187
|
See `OpenWISP Support Channels <http://openwisp.org/support.html>`_.
|
|
185
|
-
|
|
186
|
-
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[tool.coverage.run]
|
|
2
|
+
source = ["flat_json_widget"]
|
|
3
|
+
omit = [
|
|
4
|
+
"flat_json_widget/__init__.py",
|
|
5
|
+
"*/tests/*",
|
|
6
|
+
"*/migrations/*",
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
[tool.isort]
|
|
10
|
+
known_third_party = ["django"]
|
|
11
|
+
default_section = "THIRDPARTY"
|
|
12
|
+
line_length = 88
|
|
13
|
+
multi_line_output = 3
|
|
14
|
+
use_parentheses = true
|
|
15
|
+
include_trailing_comma = true
|
|
16
|
+
force_grid_wrap = 0
|
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
|
|
5
2
|
from setuptools import find_packages, setup
|
|
6
3
|
|
|
7
4
|
from flat_json_widget import get_version
|
|
8
5
|
|
|
9
|
-
if sys.argv[-1] == 'publish':
|
|
10
|
-
# delete any *.pyc, *.pyo and __pycache__
|
|
11
|
-
os.system('find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf')
|
|
12
|
-
os.system('python setup.py sdist bdist_wheel')
|
|
13
|
-
os.system('twine upload -s dist/*')
|
|
14
|
-
os.system('rm -rf dist build')
|
|
15
|
-
args = {'version': get_version()}
|
|
16
|
-
print('You probably want to also tag the version now:')
|
|
17
|
-
print(' git tag -a %(version)s -m "version %(version)s"' % args)
|
|
18
|
-
print(' git push --tags')
|
|
19
|
-
sys.exit()
|
|
20
|
-
|
|
21
|
-
|
|
22
6
|
setup(
|
|
23
7
|
name='django-flat-json-widget',
|
|
24
8
|
version=get_version(),
|
|
25
9
|
license='BSD-3-Clause',
|
|
26
|
-
author='
|
|
27
|
-
author_email='
|
|
10
|
+
author='OpenWISP',
|
|
11
|
+
author_email='support@openwisp.io',
|
|
28
12
|
description='Django Flat JSON Key/Value Widget',
|
|
29
13
|
long_description=open('README.rst').read(),
|
|
30
14
|
url='https://github.com/openwisp/django-flat-json-widget',
|
|
@@ -37,12 +21,12 @@ setup(
|
|
|
37
21
|
install_requires=[],
|
|
38
22
|
extras_require={
|
|
39
23
|
'test': [
|
|
40
|
-
'openwisp-utils[qa]~=1.
|
|
41
|
-
'django-extensions~=3.
|
|
24
|
+
'openwisp-utils[qa]~=1.1.0',
|
|
25
|
+
'django-extensions~=3.2.0',
|
|
42
26
|
]
|
|
43
27
|
},
|
|
44
28
|
classifiers=[
|
|
45
|
-
'Development Status ::
|
|
29
|
+
'Development Status :: 5 - Production/Stable ',
|
|
46
30
|
'Environment :: Web Environment',
|
|
47
31
|
'Topic :: Internet :: WWW/HTTP',
|
|
48
32
|
'Intended Audience :: Developers',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|