diff options
| author | Simon Charette <charette.s@gmail.com> | 2022-10-31 22:28:17 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-15 13:02:36 +0100 |
| commit | 5c23d9f0c32f166c81ecb6f3f01d5077a6084318 (patch) | |
| tree | 894970cb13d8a6276b7cec051ead14bee571bdbc /django/db/backends/base/operations.py | |
| parent | d87a7b9f4b4c75fc03ce6bbf55c880a79d524306 (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.py | 4 |
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 |
