summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2024-12-07 10:07:55 -0500
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-12-09 09:46:06 +0100
commitb0b30247204aea8096b3c5456d71c2df9bc4f4ae (patch)
tree280cedb062e4c36ae8272efa72a428887276feed
parenta0db341c3c1445b22655011842542e47fb144f41 (diff)
Refs #35982 -- Made BaseDatabaseOperations.adapt_decimalfield_value() a no-op.
-rw-r--r--django/db/backends/base/operations.py3
-rw-r--r--django/db/backends/mysql/operations.py3
-rw-r--r--django/db/backends/oracle/operations.py3
-rw-r--r--django/db/backends/postgresql/operations.py3
-rw-r--r--docs/releases/5.2.txt2
5 files changed, 3 insertions, 11 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py
index dba9fcbba8..60de2d6c79 100644
--- a/django/db/backends/base/operations.py
+++ b/django/db/backends/base/operations.py
@@ -8,7 +8,6 @@ import sqlparse
from django.conf import settings
from django.db import NotSupportedError, transaction
-from django.db.backends import utils
from django.db.models.expressions import Col
from django.utils import timezone
from django.utils.deprecation import RemovedInDjango60Warning
@@ -586,7 +585,7 @@ class BaseDatabaseOperations:
Transform a decimal.Decimal value to an object compatible with what is
expected by the backend driver for decimal (numeric) columns.
"""
- return utils.format_number(value, max_digits, decimal_places)
+ return value
def adapt_ipaddressfield_value(self, value):
"""
diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py
index 9741e6a985..9806303539 100644
--- a/django/db/backends/mysql/operations.py
+++ b/django/db/backends/mysql/operations.py
@@ -166,9 +166,6 @@ class DatabaseOperations(BaseDatabaseOperations):
"""
return [(None, ("NULL", [], False))]
- def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
- return value
-
def last_executed_query(self, cursor, sql, params):
# With MySQLdb, cursor objects have an (undocumented) "_executed"
# attribute where the exact query sent to the database is saved.
diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py
index 86340bbf4a..79c6da994e 100644
--- a/django/db/backends/oracle/operations.py
+++ b/django/db/backends/oracle/operations.py
@@ -629,9 +629,6 @@ END;
1900, 1, 1, value.hour, value.minute, value.second, value.microsecond
)
- def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
- return value
-
def combine_expression(self, connector, sub_expressions):
lhs, rhs = sub_expressions
if connector == "%%":
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index d89f81bf7e..8a0ca36a29 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -346,9 +346,6 @@ class DatabaseOperations(BaseDatabaseOperations):
def adapt_timefield_value(self, value):
return value
- def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
- return value
-
def adapt_ipaddressfield_value(self, value):
if value:
return Inet(value)
diff --git a/docs/releases/5.2.txt b/docs/releases/5.2.txt
index b6c44c43f8..907159e36d 100644
--- a/docs/releases/5.2.txt
+++ b/docs/releases/5.2.txt
@@ -399,6 +399,8 @@ backends.
* The new :meth:`Model._is_pk_set() <django.db.models.Model._is_pk_set>` method
allows checking if a Model instance's primary key is defined.
+* ``BaseDatabaseOperations.adapt_decimalfield_value()`` is now a no-op, simply
+ returning the given value.
:mod:`django.contrib.gis`
-------------------------