summaryrefslogtreecommitdiff
path: root/django/db/backends/base/operations.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2022-10-31 22:28:17 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-11-15 13:02:36 +0100
commit5c23d9f0c32f166c81ecb6f3f01d5077a6084318 (patch)
tree894970cb13d8a6276b7cec051ead14bee571bdbc /django/db/backends/base/operations.py
parentd87a7b9f4b4c75fc03ce6bbf55c880a79d524306 (diff)
Refs #33308 -- Used get_db_prep_value() to adapt JSONFields.
Diffstat (limited to 'django/db/backends/base/operations.py')
-rw-r--r--django/db/backends/base/operations.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py
index dd29068495..407681a418 100644
--- a/django/db/backends/base/operations.py
+++ b/django/db/backends/base/operations.py
@@ -1,5 +1,6 @@
import datetime
import decimal
+import json
from importlib import import_module
import sqlparse
@@ -575,6 +576,9 @@ class BaseDatabaseOperations:
"""
return value or None
+ def adapt_json_value(self, value, encoder):
+ return json.dumps(value, cls=encoder)
+
def year_lookup_bounds_for_date_field(self, value, iso_year=False):
"""
Return a two-elements list with the lower and upper bound to be used