django-flat-json-widget


Namedjango-flat-json-widget JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://github.com/openwisp/django-flat-json-widget
SummaryDjango Flat JSON Key/Value Widget
upload_time2024-08-23 15:26:19
maintainerNone
docs_urlNone
authorOpenWISP
requires_pythonNone
licenseBSD-3-Clause
keywords django json key-value widget
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            django-flat-json-widget
=======================

.. image:: https://github.com/openwisp/django-flat-json-widget/workflows/Django%20Flat%20JSON%20Widget%20CI%20Build/badge.svg?branch=master
    :target: https://github.com/openwisp/openwisp-controller/actions?query=workflow%3A%22Django%20Flat%20JSON%20Widget%20CI%20Build%22
    :alt: CI build status

.. image:: https://coveralls.io/repos/openwisp/django-flat-json-widget/badge.svg
    :target: https://coveralls.io/r/openwisp/django-flat-json-widget
    :alt: Test Coverage

.. image:: https://img.shields.io/librariesio/release/github/openwisp/django-flat-json-widget
    :target: https://libraries.io/github/openwisp/django-flat-json-widget#repository_dependencies
    :alt: Dependency monitoring

.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
    :target: https://gitter.im/openwisp/general
    :alt: Chat

.. image:: https://badge.fury.io/py/django-flat-json-widget.svg
    :target: http://badge.fury.io/py/django-flat-json-widget
    :alt: Pypi Version

.. image:: https://pepy.tech/badge/django-flat-json-widget
    :target: https://pepy.tech/project/django-flat-json-widget
    :alt: Downloads

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://pypi.org/project/black/
    :alt: code style: black

.. image:: https://raw.githubusercontent.com/openwisp/django-flat-json-widget/master/docs/django-flat-json-widget-demo.gif
    :target: https://github.com/openwisp/django-flat-json-widget/tree/master/docs/django-flat-json-widget-demo.gif
    :alt: Django Flat JSON (key/value) Widget

----

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:

.. code-block:: shell

    pip install django-flat-json-widget

Usage
-----

Add ``flat_json_widget`` to ``INSTALLED_APPS``:

.. code-block:: python

    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:

.. code-block:: python

    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:

.. code-block:: shell

    git clone git://github.com/<your_fork>/django-flat-json-widget
    cd django-flat-json-widget/
    python setup.py develop

Install development dependencies:

.. code-block:: shell

    pip install -e .[test]
    npm install -g jslint stylelint

Create database:

.. code-block:: shell

    cd tests/
    ./manage.py migrate
    ./manage.py createsuperuser

Launch development server:

.. code-block:: shell

    ./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:

.. code-block:: shell

    ./runtests.py

Run quality assurance tests with:

.. code-block:: shell

    ./run-qa-checks

Contributing
------------

Please refer to the `OpenWISP contributing guidelines
<http://openwisp.io/docs/developer/contributing.html>`_.

Changelog
---------

See `CHANGES
<https://github.com/openwisp/django-flat-json-widget/blob/master/CHANGES.rst>`_.

License
-------

See `LICENSE
<https://github.com/openwisp/django-flat-json-widget/blob/master/LICENSE>`_.

Support
-------

See `OpenWISP Support Channels <http://openwisp.org/support.html>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openwisp/django-flat-json-widget",
    "name": "django-flat-json-widget",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "django, json, key-value, widget",
    "author": "OpenWISP",
    "author_email": "support@openwisp.io",
    "download_url": "https://files.pythonhosted.org/packages/c2/ac/ad2c7f4e34f36af517f9dc0ca237fa2a8370ec0a7b1b46b2aafb798627ca/django_flat_json_widget-0.3.tar.gz",
    "platform": "Platform Independent",
    "description": "django-flat-json-widget\n=======================\n\n.. image:: https://github.com/openwisp/django-flat-json-widget/workflows/Django%20Flat%20JSON%20Widget%20CI%20Build/badge.svg?branch=master\n    :target: https://github.com/openwisp/openwisp-controller/actions?query=workflow%3A%22Django%20Flat%20JSON%20Widget%20CI%20Build%22\n    :alt: CI build status\n\n.. image:: https://coveralls.io/repos/openwisp/django-flat-json-widget/badge.svg\n    :target: https://coveralls.io/r/openwisp/django-flat-json-widget\n    :alt: Test Coverage\n\n.. image:: https://img.shields.io/librariesio/release/github/openwisp/django-flat-json-widget\n    :target: https://libraries.io/github/openwisp/django-flat-json-widget#repository_dependencies\n    :alt: Dependency monitoring\n\n.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg\n    :target: https://gitter.im/openwisp/general\n    :alt: Chat\n\n.. image:: https://badge.fury.io/py/django-flat-json-widget.svg\n    :target: http://badge.fury.io/py/django-flat-json-widget\n    :alt: Pypi Version\n\n.. image:: https://pepy.tech/badge/django-flat-json-widget\n    :target: https://pepy.tech/project/django-flat-json-widget\n    :alt: Downloads\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://pypi.org/project/black/\n    :alt: code style: black\n\n.. image:: https://raw.githubusercontent.com/openwisp/django-flat-json-widget/master/docs/django-flat-json-widget-demo.gif\n    :target: https://github.com/openwisp/django-flat-json-widget/tree/master/docs/django-flat-json-widget-demo.gif\n    :alt: Django Flat JSON (key/value) Widget\n\n----\n\nIf you ever needed to store a flexible dictionary of keys and values in\nyour django models, you may have felt the need of giving your users a\nwidget to easily manipulate the data by adding or removing rows, instead\nof having to edit the raw JSON.\n\nThis package solves exactly that problem: **it offers a widget to\nmanipulate a flat JSON object made of simple keys and values**.\n\nCompatibility\n-------------\n\nTested on python >= 3.8 and Django 3.2, 4.1 and 4.2.\n\nIt should work also on previous versions of Django.\n\nInstall stable version from pypi\n--------------------------------\n\nInstall from pypi:\n\n.. code-block:: shell\n\n    pip install django-flat-json-widget\n\nUsage\n-----\n\nAdd ``flat_json_widget`` to ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        # other apps...\n        \"flat_json_widget\",\n    ]\n\nThen load the widget where you need it, for example, here's how to use it\nin the django admin site:\n\n.. code-block:: python\n\n    from django.contrib import admin\n    from django import forms\n    from .models import JsonDocument\n\n    from flat_json_widget.widgets import FlatJsonWidget\n\n\n    class JsonDocumentForm(forms.ModelForm):\n        class Meta:\n            widgets = {\"content\": FlatJsonWidget}\n\n\n    @admin.register(JsonDocument)\n    class JsonDocumentAdmin(admin.ModelAdmin):\n        list_display = [\"name\"]\n        form = JsonDocumentForm\n\nInstalling for development\n--------------------------\n\nInstall your forked repo:\n\n.. code-block:: shell\n\n    git clone git://github.com/<your_fork>/django-flat-json-widget\n    cd django-flat-json-widget/\n    python setup.py develop\n\nInstall development dependencies:\n\n.. code-block:: shell\n\n    pip install -e .[test]\n    npm install -g jslint stylelint\n\nCreate database:\n\n.. code-block:: shell\n\n    cd tests/\n    ./manage.py migrate\n    ./manage.py createsuperuser\n\nLaunch development server:\n\n.. code-block:: shell\n\n    ./manage.py runserver 0.0.0.0:8000\n\nYou can access the admin interface at http://127.0.0.1:8000/admin/.\n\nRun tests with:\n\n.. code-block:: shell\n\n    ./runtests.py\n\nRun quality assurance tests with:\n\n.. code-block:: shell\n\n    ./run-qa-checks\n\nContributing\n------------\n\nPlease refer to the `OpenWISP contributing guidelines\n<http://openwisp.io/docs/developer/contributing.html>`_.\n\nChangelog\n---------\n\nSee `CHANGES\n<https://github.com/openwisp/django-flat-json-widget/blob/master/CHANGES.rst>`_.\n\nLicense\n-------\n\nSee `LICENSE\n<https://github.com/openwisp/django-flat-json-widget/blob/master/LICENSE>`_.\n\nSupport\n-------\n\nSee `OpenWISP Support Channels <http://openwisp.org/support.html>`_.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Django Flat JSON Key/Value Widget",
    "version": "0.3",
    "project_urls": {
        "Download": "https://github.com/openwisp/django-flat-json-widget/releases",
        "Homepage": "https://github.com/openwisp/django-flat-json-widget"
    },
    "split_keywords": [
        "django",
        " json",
        " key-value",
        " widget"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51e5e892e314dff778a42612f6c18ba2afd89cf5be0289bd12cd7699c74799e3",
                "md5": "5d055222c88d5158505619b3d4fd1320",
                "sha256": "ce578ed4fcaf1453d150cea3182f623bea2b97c58b4944aea727f301fc02ec6a"
            },
            "downloads": -1,
            "filename": "django_flat_json_widget-0.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d055222c88d5158505619b3d4fd1320",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 16245,
            "upload_time": "2024-08-23T15:26:18",
            "upload_time_iso_8601": "2024-08-23T15:26:18.098836Z",
            "url": "https://files.pythonhosted.org/packages/51/e5/e892e314dff778a42612f6c18ba2afd89cf5be0289bd12cd7699c74799e3/django_flat_json_widget-0.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2acad2c7f4e34f36af517f9dc0ca237fa2a8370ec0a7b1b46b2aafb798627ca",
                "md5": "addef371f0c670c64f9ca7cdb7f9571c",
                "sha256": "5dca5a9798ff3b59387d9ef122be33783918b12c3af9c37fbdb1105c9698572d"
            },
            "downloads": -1,
            "filename": "django_flat_json_widget-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "addef371f0c670c64f9ca7cdb7f9571c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16066,
            "upload_time": "2024-08-23T15:26:19",
            "upload_time_iso_8601": "2024-08-23T15:26:19.427862Z",
            "url": "https://files.pythonhosted.org/packages/c2/ac/ad2c7f4e34f36af517f9dc0ca237fa2a8370ec0a7b1b46b2aafb798627ca/django_flat_json_widget-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-23 15:26:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openwisp",
    "github_project": "django-flat-json-widget",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-flat-json-widget"
}
        
Elapsed time: 0.42636s