summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/lookups.py
diff options
context:
space:
mode:
authorsage <laymonage@gmail.com>2019-06-09 07:56:37 +0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-08 07:23:31 +0200
commit6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd (patch)
tree1de598fc92480c64835b60b6ddbb461c3cd2e864 /django/contrib/postgres/lookups.py
parentf97f71f59249f1fbeebe84d4fc858d70fc456f7d (diff)
downloaddjango-6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd.tar.gz
Fixed #12990, Refs #27694 -- Added JSONField model field.
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'django/contrib/postgres/lookups.py')
-rw-r--r--django/contrib/postgres/lookups.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/django/contrib/postgres/lookups.py b/django/contrib/postgres/lookups.py
index 360e0c6a31..28d8590e1d 100644
--- a/django/contrib/postgres/lookups.py
+++ b/django/contrib/postgres/lookups.py
@@ -1,5 +1,5 @@
from django.db.models import Transform
-from django.db.models.lookups import Exact, PostgresOperatorLookup
+from django.db.models.lookups import PostgresOperatorLookup
from .search import SearchVector, SearchVectorExact, SearchVectorField
@@ -58,12 +58,3 @@ class SearchLookup(SearchVectorExact):
class TrigramSimilar(PostgresOperatorLookup):
lookup_name = 'trigram_similar'
postgres_operator = '%%'
-
-
-class JSONExact(Exact):
- can_use_none_as_rhs = True
-
- def process_rhs(self, compiler, connection):
- result = super().process_rhs(compiler, connection)
- # Treat None lookup values as null.
- return ("'null'", []) if result == ('%s', [None]) else result