{ "info": { "author": "Matthew Schinckel", "author_email": "matt@schinckel.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "django-jsonfield\n================\n\n**Maintenance mode only:** It is not recommended you use this library on new\nprojects. See the (long) **History** section below for why and alternatives.\n\n----\n\nCross-database JSON field for Django models.\n\nHistory\n-------\n\n\nThis project was created in 2010 by Matthew Schinckel. He created it based upon\ncode from `David Cramer's\nblog `_,\nhad the repository in Mercurial on\n`BitBucket `_, and\nmaintained it until 2018. In March 2019, Adam Johnson took over maintenance\n(from an invite back in 2018!), and moved it to Git on\n`GitHub `_ because he's no good\nat Mercurial and \"everyone\" uses GitHub these days.\n\nAt the time it was created, the databases that Django supports didn't feature\nnative JSON support. Since then, most of them have gained that ability.\nCorrespondingly, there are some Django field implementations for taking\nadvantage of this:\n\n* A PostgreSQL ``JSONField`` is provided in\n `django.contrib.postgres `_,\n which was created as part of Django in version 1.9, released December 2015.\n Note this library interferes with the way that works, see\n `issue 5 `_ for\n explanation and a workaround.\n* A MySQL (and maybe MariaDB) ``JSONField`` is provided in\n `Django-MySQL `_,\n since version 1.0.7, released March 2016.\n\nAt time of writing this history (March 2019), there still isn't a JSONField\nimplementation that can take advantage of the native features on all the\ndatabases. This has been discussed on the ``django-developers`` mailing list\nseveral times though.\n\nThe ``JSONField`` provided by this library uses native features on\nPostgreSQL, but not on any other database, so it's in a bit of a weird place.\n\nIf you are considering adding this to a new project, you probably don't want\nit, instead:\n\n* If you want native JSON support from your database and you're using\n PostgreSQL or MySQL, use the native fields as per the links above.\n* If you don't want native JSON support, consider just storing the JSON in a\n ``TextField`` and deserializing it appropriately in your code, perhaps with\n a simple model property to proxy it.\n* If you need native JSON support on a database for which there is no Django\n field implementation, try making it yourself or getting in touch to see if\n there's something that can be done.\n\nInstallation\n------------\n\nInstall it with **pip**:\n\n.. code-block:: sh\n\n pip install django-jsonfield\n\nThen use the field in your models:\n\n.. code-block:: python\n\n from django.db import models\n import jsonfield\n\n class MyModel(models.Model):\n the_json = jsonfield.JSONField()\n\nYou can assign any JSON-encodable object to this field. It will be\nJSON-encoded before being stored in the database as a text value and it\nwill be turned back into a python list/dict/string upon retrieval from the\ndatabase.\n\nThere is also a ``TypedJSONField``, that allows you to define data types that\nmust be included within each object in the array. More documentation to follow.\n\nNotes\n~~~~~\n\nIf no ``default`` is provided, and ``null=True`` is not passed in to the\nfield constructor, then a default of ``{}`` will be used.\n\nSupported django versions\n-------------------------\n\nAll versions of Django from 1.8 onwards are tested.\n\nExtras\n------\n\njsonify templatetag\n~~~~~~~~~~~~~~~~~~~\nThis allows you to convert a python data structure into JSON within a template::\n\n {% load jsonify %}\n\n \n\nNote that you must only use the \"safe\" filter when you use the jsonify\nfilter within a