{ "info": { "author": "Artem Kolesnikov", "author_email": "tyomo4ka@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=============================\ndjango-reactive\n=============================\n\n.. image:: https://badge.fury.io/py/django-reactive.svg\n :target: https://badge.fury.io/py/django-reactive\n\n.. image:: https://travis-ci.org/tyomo4ka/django-reactive.svg?branch=master\n :target: https://travis-ci.org/tyomo4ka/django-reactive\n\n.. image:: https://codecov.io/gh/tyomo4ka/django-reactive/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/tyomo4ka/django-reactive\n\ndjango-reactive integrates `react-jsonschema-form `_ (RJSF)\nin Django projects.\n\nMotivation\n----------\n\nIn our opinion, `JSON types `_ is an extremely useful feature of\nPostgres. It helps developers to combine relational and non-relational approaches to storing data which in many cases\ncan significantly simplify database design for web applications.\n\nThe `JSONField `_ in Django provides a\nnice way of integrating **json** and **jsonb** Postgres types with the ORM in that way that we even can include such\nfields in database queries. Considering **jsonb** type offers a way of indexing JSON documents it becomes a powerful\ntool in the application design opening a wide range of use cases, e.g. polymorphic behaviour, storing complex\nhierarchies and lists of related entities.\n\nHowever, the main limitation of JSONField in Django is that it does not offer a nice way of configuring such objects in\ndefault admin UI. Defining JSON objects inside the textarea is not practical for most use cases. Thus, django-reactive\ntries to close this gap by offering an integration of JSONField with an awesome\n`react-jsonschema-form `_ (RJSF) JS library and Python's\n`jsonschema ` for backend validation. Such integration from our practice can\nsignificantly reduce an amount of work you need to spend on building custom forms for JSONField types.\n\nIn this case developers only need to come up with JSON schema for such field and optionally UI schema to modify behavior\nof such forms.\n\nThe simplest example would looks like this:\n\n.. code-block:: python\n\n from django.db import models\n\n from django_reactive.fields import ReactJSONSchemaField\n\n\n class TestModel(models.Model):\n simple = ReactJSONSchemaField(\n help_text='Simple',\n schema={\n \"title\": \"A registration form\",\n \"description\": \"A simple form example.\",\n \"type\": \"object\",\n \"required\": [\n \"firstName\",\n \"lastName\"\n ],\n \"properties\": {\n \"firstName\": {\n \"type\": \"string\",\n \"title\": \"First name\"\n },\n \"lastName\": {\n \"type\": \"string\",\n \"title\": \"Last name\"\n },\n \"age\": {\n \"type\": \"integer\",\n \"title\": \"Age\"\n },\n \"bio\": {\n \"type\": \"string\",\n \"title\": \"Bio\"\n },\n \"password\": {\n \"type\": \"string\",\n \"title\": \"Password\",\n \"minLength\": 3\n },\n \"telephone\": {\n \"type\": \"string\",\n \"title\": \"Telephone\",\n \"minLength\": 10\n }\n }\n },\n ui_schema={\n \"firstName\": {\n \"ui:autofocus\": True,\n \"ui:emptyValue\": \"\"\n },\n \"age\": {\n \"ui:widget\": \"updown\",\n \"ui:title\": \"Age of person\",\n \"ui:description\": \"(earthian year)\"\n },\n \"bio\": {\n \"ui:widget\": \"textarea\"\n },\n \"password\": {\n \"ui:widget\": \"password\",\n \"ui:help\": \"Hint: Make it strong!\"\n },\n \"date\": {\n \"ui:widget\": \"alt-datetime\"\n },\n \"telephone\": {\n \"ui:options\": {\n \"inputType\": \"tel\"\n }\n }\n },\n )\n\nWill generate a form like shown on the screenshot below:\n\n.. image:: images/simple.png\n\nQuickstart\n----------\n\nInstall django-reactive::\n\n pip install django-reactive\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'django_reactive.apps.DjangoReactJsonSchemaFormConfig',\n ...\n )\n\nFeatures\n--------\n\n* React, RJSF and other JS assets are bundled with the package.\n* Integration with default Django admin theme.\n* Backend and frontend validation.\n\nLimitations\n-----------\n\n* `Additional properties `_ feature of\n**RJSF** is not supported. To implement this behaviour you can define an array schema with one property serving as a key\nof the object and do transformation in your JSON class. An example will be provided later.\n\nFuture development\n------------------\n\n* Display description in the form as a tooltip.\n* Polish styles and HTML generated by **RJSF**.\n\n\n\n\nHistory\n-------\n\n0.1.0 (2018-12-01)\n++++++++++++++++++\n\n* First release on PyPI.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tyomo4ka/django-reactive", "keywords": "django-reactive", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-reactive", "package_url": "https://pypi.org/project/django-reactive/", "platform": "", "project_url": "https://pypi.org/project/django-reactive/", "project_urls": { "Homepage": "https://github.com/tyomo4ka/django-reactive" }, "release_url": "https://pypi.org/project/django-reactive/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Django JSON form field on steroids using react-json-schema-form.", "version": "0.0.2" }, "last_serial": 4606490, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "43f3b4de3d82e7791ae1cbb9758b8709", "sha256": "aec6ad1756ac86337d84525247ececb3073581f8bb241c8c34f0a9ee0a016852" }, "downloads": -1, "filename": "django-reactive-0.0.1.tar.gz", "has_sig": false, "md5_digest": "43f3b4de3d82e7791ae1cbb9758b8709", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 268785, "upload_time": "2018-12-09T02:41:31", "url": "https://files.pythonhosted.org/packages/2b/72/16f71fdb10ff72440ec323154f1cc65780a9e2c0f855d7e0b14462328c52/django-reactive-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8e6ffba908583eebcb3a5bc3266ce71f", "sha256": "5db46c052baf3fb5b82bb03fcb8428a3a8923031f01fc549b19782569be3127a" }, "downloads": -1, "filename": "django-reactive-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8e6ffba908583eebcb3a5bc3266ce71f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 268811, "upload_time": "2018-12-17T05:33:09", "url": "https://files.pythonhosted.org/packages/eb/e4/36739235e52985a65cf26dc1804da575f60a778179bbaa33793fe6185569/django-reactive-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e6ffba908583eebcb3a5bc3266ce71f", "sha256": "5db46c052baf3fb5b82bb03fcb8428a3a8923031f01fc549b19782569be3127a" }, "downloads": -1, "filename": "django-reactive-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8e6ffba908583eebcb3a5bc3266ce71f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 268811, "upload_time": "2018-12-17T05:33:09", "url": "https://files.pythonhosted.org/packages/eb/e4/36739235e52985a65cf26dc1804da575f60a778179bbaa33793fe6185569/django-reactive-0.0.2.tar.gz" } ] }