{ "info": { "author": "Marc Zimmermann", "author_email": "tooreht@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "django-jsonsuit\n===============\n\n|image| |image| |image|\n\nDjango goodies to dress JSON data in a suit.\n\nDocumentation\n-------------\n\nThe full documentation is at https://tooreht.github.io/django-jsonsuit.\n\nFeatures\n--------\n\n- Editable and readonly widget\n- Change JSON syntax highlighter themes\n- Set custom widget media (JS & CSS) files\n- Use custom HTML templates\n\nQuickstart\n----------\n\nInstall django-jsonsuit:\n\n::\n\n pip install django-jsonsuit\n\nAdd it to your ``INSTALLED_APPS``:\n\n.. code:: sourcecode\n\n INSTALLED_APPS = (\n ...\n 'jsonsuit.apps.JSONSuitConfig',\n ...\n )\n\nUsage\n-----\n\nWidgets\n~~~~~~~\n\ndjango-jsonsuit currently provides two widgets to dress your JSON data:\n\n1. ``JSONSuit``: Widget that displays JSON data with indentation and\n syntax highlighting as default, but allows to toggle between the\n standard django ``Textarea`` for editing.\n2. ``ReadonlyJSONSuit``: Widget that simply displays JSON data with\n indentation and syntax highlighting. It is useful for JSON fields\n that contain readonly data.\n\n**Note**: Because a widget in django is only responsible for displaying\nfields, it has no direct access to its field properties. Thus there is\nno easy way to check if the field is readonly. The readonly behaviour is\neven handled differently among django forms, model forms and admin. This\nis why the ``ReadonlyJSONSuit`` was introduced.\n\nJSONSuit\n^^^^^^^^\n\nIn a form or model admin, enable a JSON suit for a particular field:\n\n.. code:: python\n\n from jsonsuit.widgets import JSONSuit\n\n class JSONForm(forms.ModelForm):\n class Meta:\n model = Test\n fields = '__all__'\n widgets = {\n 'myjsonfield': JSONSuit(),\n }\n\n class JSONAdmin(admin.ModelAdmin):\n form = JSONForm\n\nEnable JSON suit for every JSONField of a model:\n\n.. code:: python\n\n from django.contrib.postgres.fields import JSONField\n\n class JSONAdmin(admin.ModelAdmin):\n formfield_overrides = {\n JSONField: {'widget': JSONSuit }\n }\n\nReadonlyJSONSuit\n^^^^^^^^^^^^^^^^\n\nIn a form or model admin, enable a readonly JSON suit for a particular\nfield:\n\n.. code:: python\n\n from jsonsuit.widgets import ReadonlyJSONSuit\n\n class ReadonlyJSONForm(forms.ModelForm):\n class Meta:\n model = Test\n fields = '__all__'\n widgets = {\n 'myjsonfield': ReadonlyJSONSuit(),\n }\n\n class ReadonlyJSONAdmin(admin.ModelAdmin):\n form = ReadonlyJSONForm\n\nEnable readonly JSON suit for every JSONField of a model:\n\n.. code:: python\n\n from django.contrib.postgres.fields import JSONField\n\n class ReadonlyJSONAdmin(admin.ModelAdmin):\n formfield_overrides = {\n JSONField: {'widget': ReadonlyJSONSuit }\n }\n\nTemplate Tags\n~~~~~~~~~~~~~\n\nUse the jsonsuit template tag to display serializable objects in\ntemplates. Note that in order to use the ``jsonsuit``, ``jsonsuit_css``\nand ``jsonsuit_js`` tags, they must be loaded using\n``{% load jsonsuit %}``.\n\n.. code:: html\n\n {% extends \"ui/base.html\" %}\n {% load jsonsuit %}\n\n {% block title %}{% trans \"JSONSuit Template Tag\" %}{% endblock %}\n\n {% block styles %}\n {{ block.super }}\n {% jsonsuit_css %} \n {% endblock %}\n\n {% block content %}\n
\n
\n

Unnamed Suit

\n {% jsonsuit data %} \n
\n
\n

Named Suit

\n {% jsonsuit data 'suit_name' %} \n
\n
\n {% endblock %}\n\n {% block scripts %}\n {{ block.super }}\n {% jsonsuit_js %} \n {% endblock %}\n\nTheme\n~~~~~\n\nSet JSON syntax highlighter theme in settings:\n\n.. code:: python\n\n JSONSUIT_WIDGET_THEME = 'twilight'\n\nAvailable themes: ``coy``, ``dark``, ``default``, ``funky``,\n``okaidia``, ``solarizedlight``, ``twilight``. Defaults to the\n``default`` theme.\n\nCustom Widget Media\n~~~~~~~~~~~~~~~~~~~\n\nSet custom widget media (JS & CSS) files:\n\n.. code:: python\n\n JSONSUIT_WIDGET_MEDIA_JS = (\n 'jsonsuit/js/mysyntaxhighlighter.js', 'jsonsuit/js/myscripts.js'\n )\n\n JSONSUIT_WIDGET_MEDIA_CSS = {\n 'all': ('jsonsuit/css/mytheme.css', 'jsonsuit/css/mystyles.css')\n }\n\n JSONSUIT_READONLY_WIDGET_MEDIA_JS = (\n 'jsonsuit/js/mysyntaxhighlighter.js', 'jsonsuit/js/myreadonlyscripts.js'\n )\n\n JSONSUIT_READONLY_WIDGET_MEDIA_CSS = {\n 'all': ('jsonsuit/css/mytheme.css', 'jsonsuit/css/myreadonlystyles.css')\n }\n\nTo only replace the syntax highlighter assets for all widgets, simply\nchange:\n\n.. code:: python\n\n JSONSUIT_SYNTAX_HIGHLIGHTER_JS = ('jsonsuit/js/mysyntaxhighlighter.js',)\n JSONSUIT_SYNTAX_HIGHLIGHTER_CSS = ('jsonsuit/css/mytheme.css',)\n\nCustom HTML template\n~~~~~~~~~~~~~~~~~~~~\n\nOverride ``jsonsuit/widget.html`` or ``jsonsuit/readonly_widget.html``\ntemplate:\n\n.. code:: bash\n\n jsonsuit/templates\n \u2514\u2500\u2500 jsonsuit\n \u2514\u2500\u2500 widget.html\n \u2514\u2500\u2500 readonly_widget.html\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source /bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\nCredits\n-------\n\nProject dependencies:\n\n- `prism `__\n- `vanilla-js `__\n\nProject documentation:\n\n- `MkDocs `__\n\nTools used in rendering this package:\n\n- `Cookiecutter `__\n- `cookiecutter-djangopackage `__\n\n.. |image| image:: https://badge.fury.io/py/django-jsonsuit.svg\n.. |image| image:: https://travis-ci.org/tooreht/django-jsonsuit.svg?branch=master\n.. |image| image:: https://codecov.io/gh/tooreht/django-jsonsuit/branch/master/graph/badge.svg\n\n\n\nHistory\n-------\n\nVersion 0.4.4 (2018-01-31)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Update django doc links\n- Remove unused load of i18n template tag\n- Update prism assets\n\nVersion 0.4.3 (2018-01-19)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Fix toggling of JSON field instead of submitting\n- Fix test for jsonsuit template tag\n- Update test requirements\n- Add renderer kwarg to the widget render fn\n- Fix tox and travis config\n\nVersion 0.4.2 (2017-07-03)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Fix test for jsonsuit template tag\n- Fix jsonsuit template tag for empty strings and add test case\n\nVersion 0.4.1 (2017-06-19)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Simplify tests to work with multiple python versions\n- Fix docs about template tags\n\nVersion 0.4.0 (2017-06-18)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Add jsonsuit template tags\n\nVersion 0.3.0 (2017-06-02)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Add ReadonlyJSONSuit widget\n- Make app settings more modular\n- Make JS code more generic (mostly using classes in selectors)\n- Use Prism\u2019s \u201cdefault\u201d theme as default\n\nVersion 0.2.0 (2017-05-14)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Change JSON syntax highlighter themes\n- Set custom widget media (JS & CSS) files\n- Use custom HTML template\n\nVersion 0.1.0 (2017-05-13)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tooreht/django-jsonsuit", "keywords": "django-jsonsuit", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-jsonsuit", "package_url": "https://pypi.org/project/django-jsonsuit/", "platform": "", "project_url": "https://pypi.org/project/django-jsonsuit/", "project_urls": { "Homepage": "https://github.com/tooreht/django-jsonsuit" }, "release_url": "https://pypi.org/project/django-jsonsuit/0.4.4/", "requires_dist": null, "requires_python": "", "summary": "Django goodies to dress JSON data in a suit.", "version": "0.4.4" }, "last_serial": 3538596, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "956a2ec70fef5f4a38a0abd87038fc58", "sha256": "6235e7e3965c6cf08860cd057d802bafca0f39af7bef6d426dac9de757c04ff4" }, "downloads": -1, "filename": "django_jsonsuit-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "956a2ec70fef5f4a38a0abd87038fc58", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 11907, "upload_time": "2017-05-13T16:31:10", "url": "https://files.pythonhosted.org/packages/17/b1/0d96298b3b6275899bca54160ab9ec167bbdb14e92be7106aa859537f8cb/django_jsonsuit-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83962f1643fe3e697aaf29e527906f6a", "sha256": "110336bf8d989da70353d716d1b45d077ac01cf31ac6961e508269d5f0d624ff" }, "downloads": -1, "filename": "django-jsonsuit-0.1.0.tar.gz", "has_sig": false, "md5_digest": "83962f1643fe3e697aaf29e527906f6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12557, "upload_time": "2017-05-13T16:31:08", "url": "https://files.pythonhosted.org/packages/8e/0e/32d37fbed7a013ea2021f789aa65e8d635b5ef59efe833ad1bd7a7fbbe04/django-jsonsuit-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e09dad409775f05f3ca8fa2a3a6fc527", "sha256": "54c92a29bb240aa48565dc13ab34bc3ca7300d888e3f5263ce20b6145eca7aae" }, "downloads": -1, "filename": "django_jsonsuit-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e09dad409775f05f3ca8fa2a3a6fc527", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 20450, "upload_time": "2017-05-14T20:30:49", "url": "https://files.pythonhosted.org/packages/c7/3d/8f89cfb56dc1b9f446ee8393a6b0ed570473cc1d98f549ba75742c41ba3a/django_jsonsuit-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60d3395243b44de3c631eb0908446b53", "sha256": "74ed60844ca38258ba278419181bf790c8c3a95991cdf8e396c8862c7caef4b2" }, "downloads": -1, "filename": "django-jsonsuit-0.2.0.tar.gz", "has_sig": false, "md5_digest": "60d3395243b44de3c631eb0908446b53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16014, "upload_time": "2017-05-14T20:30:45", "url": "https://files.pythonhosted.org/packages/2d/27/d495d5cf36736cd9d646f61654924768395128927238f47b9c664c1deaca/django-jsonsuit-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "4b6a1e49fabfa830907cf4d898c188a6", "sha256": "7274ef1c3dc86b72c28a037733bdd1b770daed243a5d58e97464827ba8dbfaf9" }, "downloads": -1, "filename": "django_jsonsuit-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4b6a1e49fabfa830907cf4d898c188a6", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 23120, "upload_time": "2017-06-02T13:21:20", "url": "https://files.pythonhosted.org/packages/35/62/afcb345aa73a41ed5dd1b17a8f0112c4a467c9e75d8861d3bd5555c4cc31/django_jsonsuit-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "354cad93062931b4aeec9f699c8a6a50", "sha256": "b217b6f97677e2d4aabeab9c660caf02f1aa6bea88932ddb7a20e1cad813d1a6" }, "downloads": -1, "filename": "django-jsonsuit-0.3.0.tar.gz", "has_sig": false, "md5_digest": "354cad93062931b4aeec9f699c8a6a50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18163, "upload_time": "2017-06-02T13:21:17", "url": "https://files.pythonhosted.org/packages/29/f5/94e1bb638f93b27f965193e74d1d8a80866d8a09eed9124b785482cc24af/django-jsonsuit-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "5db374412730e5b954adc2827a17f089", "sha256": "11c704ba72840f502522f9b757f1a527c8e3779557eabe986319eb0afd47dce5" }, "downloads": -1, "filename": "django_jsonsuit-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5db374412730e5b954adc2827a17f089", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 24364, "upload_time": "2017-06-18T20:42:23", "url": "https://files.pythonhosted.org/packages/64/fc/fcef3322311058c505ded91054ddb2741f67e82b42e86a3feea9a0d47b46/django_jsonsuit-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9009765bb2b985b5755ebf0e740afe0e", "sha256": "11f87208d2a2a7f1a32b3557fcc1f47561c5a90922ce16ca465ab5e5bccc7286" }, "downloads": -1, "filename": "django-jsonsuit-0.4.0.tar.gz", "has_sig": false, "md5_digest": "9009765bb2b985b5755ebf0e740afe0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19390, "upload_time": "2017-06-18T20:42:19", "url": "https://files.pythonhosted.org/packages/e8/68/e09bd2389cbe8b89eab819dcff7e87a90bb26b42c34259c720f0fd2592e1/django-jsonsuit-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "346f909ba9658b7f9bd91f16dc32f7e9", "sha256": "9ed72bbfd1242e0b63212e9bc6b576bb3ef53df3028b148d95b052a003813b61" }, "downloads": -1, "filename": "django_jsonsuit-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "346f909ba9658b7f9bd91f16dc32f7e9", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 24590, "upload_time": "2017-06-19T11:51:39", "url": "https://files.pythonhosted.org/packages/75/dc/30a8be691691ada6749d6eb0a26f36a0a3f699997514148aec9f1a49c8a6/django_jsonsuit-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "336eeafae084c4d982790630dc008a57", "sha256": "264e058609e34b4f57aa8a852a2ea136f1bc68842e67fc5dada5ddb211120868" }, "downloads": -1, "filename": "django-jsonsuit-0.4.1.tar.gz", "has_sig": false, "md5_digest": "336eeafae084c4d982790630dc008a57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19715, "upload_time": "2017-06-19T11:51:36", "url": "https://files.pythonhosted.org/packages/a9/0e/8eaabb7355d6f77896564c5b9107037e6d76b72dca493691a23a46d014df/django-jsonsuit-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "0c4f7b4390bf4898758356aebfe6404a", "sha256": "4465fda6b47476265ca1ee0960327fe79ed328e18ee7c32adbd2ac8067823e6e" }, "downloads": -1, "filename": "django_jsonsuit-0.4.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c4f7b4390bf4898758356aebfe6404a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 24663, "upload_time": "2017-07-03T11:03:10", "url": "https://files.pythonhosted.org/packages/ab/23/2ae1b3c51e114bf60978f4730270b3e6534d431f4945730b8ec4b8588d33/django_jsonsuit-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8b5677eb0696b05e8173615a40da96a", "sha256": "8677c6d250201f8b8a47b5ec3a90c5bcef7f529c15e436534183186ed8f5448e" }, "downloads": -1, "filename": "django-jsonsuit-0.4.2.tar.gz", "has_sig": false, "md5_digest": "c8b5677eb0696b05e8173615a40da96a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19815, "upload_time": "2017-07-03T11:03:06", "url": "https://files.pythonhosted.org/packages/64/f8/cf8d03595a18839b0dcab0867562b6db64204cf215e19dfeeb0e425150d0/django-jsonsuit-0.4.2.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "9289f58cea28e41c9bff75a61ec249d2", "sha256": "d53a774551ea26ed31c3dbd33df2a8a62066ad751299732158e34ae144d24053" }, "downloads": -1, "filename": "django_jsonsuit-0.4.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9289f58cea28e41c9bff75a61ec249d2", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 25077, "upload_time": "2018-01-31T15:05:26", "url": "https://files.pythonhosted.org/packages/1f/63/8785f9890af262fa6f2924502f70dd8da5969d90a520e7fdb2d0a7834eff/django_jsonsuit-0.4.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a0e397fe8ba0db3a798919be2e6973a", "sha256": "672f79bf0b5f528a07d85a04cb8a1f3e6d91f469c30e8df0ce354c56f7c7673d" }, "downloads": -1, "filename": "django-jsonsuit-0.4.4.tar.gz", "has_sig": false, "md5_digest": "9a0e397fe8ba0db3a798919be2e6973a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20223, "upload_time": "2018-01-31T15:05:22", "url": "https://files.pythonhosted.org/packages/37/e9/5750fa8e4bd0f0204fc60fc7a51072382affd94d3d998c45712c0d903328/django-jsonsuit-0.4.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9289f58cea28e41c9bff75a61ec249d2", "sha256": "d53a774551ea26ed31c3dbd33df2a8a62066ad751299732158e34ae144d24053" }, "downloads": -1, "filename": "django_jsonsuit-0.4.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9289f58cea28e41c9bff75a61ec249d2", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 25077, "upload_time": "2018-01-31T15:05:26", "url": "https://files.pythonhosted.org/packages/1f/63/8785f9890af262fa6f2924502f70dd8da5969d90a520e7fdb2d0a7834eff/django_jsonsuit-0.4.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a0e397fe8ba0db3a798919be2e6973a", "sha256": "672f79bf0b5f528a07d85a04cb8a1f3e6d91f469c30e8df0ce354c56f7c7673d" }, "downloads": -1, "filename": "django-jsonsuit-0.4.4.tar.gz", "has_sig": false, "md5_digest": "9a0e397fe8ba0db3a798919be2e6973a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20223, "upload_time": "2018-01-31T15:05:22", "url": "https://files.pythonhosted.org/packages/37/e9/5750fa8e4bd0f0204fc60fc7a51072382affd94d3d998c45712c0d903328/django-jsonsuit-0.4.4.tar.gz" } ] }