summaryrefslogtreecommitdiff
path: root/django/contrib/postgres
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2022-12-12 09:54:49 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-12 10:36:45 +0100
commitdb7bb3b64e469fbb5c79e7b5b2fcb890434aa60f (patch)
treefc995dec5ccb21baf840b2303b5e59df67e50bfa /django/contrib/postgres
parent1d90c9b1132482d446ca8375c151e894002c9e8d (diff)
Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL.
Diffstat (limited to 'django/contrib/postgres')
-rw-r--r--django/contrib/postgres/search.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/django/contrib/postgres/search.py b/django/contrib/postgres/search.py
index 2b57156263..05c8f72f6f 100644
--- a/django/contrib/postgres/search.py
+++ b/django/contrib/postgres/search.py
@@ -1,5 +1,3 @@
-import psycopg2
-
from django.db.models import (
CharField,
Expression,
@@ -309,14 +307,9 @@ class SearchHeadline(Func):
options_sql = ""
options_params = []
if self.options:
- # getquoted() returns a quoted bytestring of the adapted value.
options_params.append(
", ".join(
- "%s=%s"
- % (
- option,
- psycopg2.extensions.adapt(value).getquoted().decode(),
- )
+ connection.ops.compose_sql(f"{option}=%s", [value])
for option, value in self.options.items()
)
)