summaryrefslogtreecommitdiff
path: root/docs/ref/contrib/postgres
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 09:33:12 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit7cb5712edc158396c9d4fbf1ecf17794d9a128b3 (patch)
treef1f5cc4116140c094311aba6d1a35d8fb8aa26c6 /docs/ref/contrib/postgres
parent98ae3925e57c3f054814b847971194f7cd8d98d1 (diff)
Refs #12990 -- Removed django.contrib.postgres.fields.JSONField per deprecation timeline.
Diffstat (limited to 'docs/ref/contrib/postgres')
-rw-r--r--docs/ref/contrib/postgres/fields.txt53
1 files changed, 0 insertions, 53 deletions
diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt
index eee99592b3..7754ff3d65 100644
--- a/docs/ref/contrib/postgres/fields.txt
+++ b/docs/ref/contrib/postgres/fields.txt
@@ -482,59 +482,6 @@ using in conjunction with lookups on
>>> Dog.objects.filter(data__values__contains=['collie'])
<QuerySet [<Dog: Meg>]>
-``JSONField``
-=============
-
-.. class:: JSONField(encoder=None, **options)
-
- A field for storing JSON encoded data. In Python the data is represented in
- its Python native format: dictionaries, lists, strings, numbers, booleans
- and ``None``.
-
- .. attribute:: encoder
-
- An optional JSON-encoding class to serialize data types not supported
- by the standard JSON serializer (``datetime``, ``uuid``, etc.). For
- example, you can use the
- :class:`~django.core.serializers.json.DjangoJSONEncoder` class or any
- other :py:class:`json.JSONEncoder` subclass.
-
- When the value is retrieved from the database, it will be in the format
- chosen by the custom encoder (most often a string), so you'll need to
- take extra steps to convert the value back to the initial data type
- (:meth:`Model.from_db() <django.db.models.Model.from_db>` and
- :meth:`Field.from_db_value() <django.db.models.Field.from_db_value>`
- are two possible hooks for that purpose). Your deserialization may need
- to account for the fact that you can't be certain of the input type.
- For example, you run the risk of returning a ``datetime`` that was
- actually a string that just happened to be in the same format chosen
- for ``datetime``\s.
-
- If you give the field a :attr:`~django.db.models.Field.default`, ensure
- it's a callable such as ``dict`` (for an empty default) or a callable that
- returns a dict (such as a function). Incorrectly using ``default={}``
- creates a mutable default that is shared between all instances of
- ``JSONField``.
-
-.. note::
-
- PostgreSQL has two native JSON based data types: ``json`` and ``jsonb``.
- The main difference between them is how they are stored and how they can be
- queried. PostgreSQL's ``json`` field is stored as the original string
- representation of the JSON and must be decoded on the fly when queried
- based on keys. The ``jsonb`` field is stored based on the actual structure
- of the JSON which allows indexing. The trade-off is a small additional cost
- on writing to the ``jsonb`` field. ``JSONField`` uses ``jsonb``.
-
-.. deprecated:: 3.1
-
- Use :class:`django.db.models.JSONField` instead.
-
-Querying ``JSONField``
-----------------------
-
-See :ref:`querying-jsonfield` for details.
-
.. _range-fields:
Range Fields