From 2dd6a83d2d7c61321ac4a9b10fbf3c379cb305c3 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 14 Jan 2021 10:04:20 +0100 Subject: [PATCH] Refs #12990 -- Removed django.contrib.postgres.forms.JSONField per deprecation timeline. --- django/contrib/postgres/forms/__init__.py | 1 - django/contrib/postgres/forms/jsonb.py | 16 ---------------- docs/ref/contrib/postgres/forms.txt | 19 ------------------- docs/releases/4.0.txt | 2 ++ tests/postgres_tests/test_json_deprecation.py | 18 ------------------ 5 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 django/contrib/postgres/forms/jsonb.py delete mode 100644 tests/postgres_tests/test_json_deprecation.py diff --git a/django/contrib/postgres/forms/__init__.py b/django/contrib/postgres/forms/__init__.py index 9158f1e7cc..bb2685eca1 100644 --- a/django/contrib/postgres/forms/__init__.py +++ b/django/contrib/postgres/forms/__init__.py @@ -1,4 +1,3 @@ from .array import * # NOQA from .hstore import * # NOQA -from .jsonb import * # NOQA from .ranges import * # NOQA diff --git a/django/contrib/postgres/forms/jsonb.py b/django/contrib/postgres/forms/jsonb.py deleted file mode 100644 index ebc85efa6f..0000000000 --- a/django/contrib/postgres/forms/jsonb.py +++ /dev/null @@ -1,16 +0,0 @@ -import warnings - -from django.forms import JSONField as BuiltinJSONField -from django.utils.deprecation import RemovedInDjango40Warning - -__all__ = ['JSONField'] - - -class JSONField(BuiltinJSONField): - def __init__(self, *args, **kwargs): - warnings.warn( - 'django.contrib.postgres.forms.JSONField is deprecated in favor ' - 'of django.forms.JSONField.', - RemovedInDjango40Warning, stacklevel=2, - ) - super().__init__(*args, **kwargs) diff --git a/docs/ref/contrib/postgres/forms.txt b/docs/ref/contrib/postgres/forms.txt index 715b376ac9..e5d597655f 100644 --- a/docs/ref/contrib/postgres/forms.txt +++ b/docs/ref/contrib/postgres/forms.txt @@ -158,25 +158,6 @@ Fields valid for a given field. This can be done using the :class:`~django.contrib.postgres.validators.KeysValidator`. -``JSONField`` -------------- - -.. class:: JSONField - - A field which accepts JSON encoded data for a - :class:`~django.db.models.JSONField`. It is represented by an HTML - ``