mirror of
https://github.com/django/django.git
synced 2024-12-31 21:46:05 +00:00
Refs #33308 -- Improved adapting DecimalField values to decimal.
This commit is contained in:
parent
5f09ab8c30
commit
7990d254b0
@ -1721,9 +1721,11 @@ class DecimalField(Field):
|
|||||||
)
|
)
|
||||||
return decimal_value
|
return decimal_value
|
||||||
|
|
||||||
def get_db_prep_save(self, value, connection):
|
def get_db_prep_value(self, value, connection, prepared=False):
|
||||||
|
if not prepared:
|
||||||
|
value = self.get_prep_value(value)
|
||||||
return connection.ops.adapt_decimalfield_value(
|
return connection.ops.adapt_decimalfield_value(
|
||||||
self.to_python(value), self.max_digits, self.decimal_places
|
value, self.max_digits, self.decimal_places
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_prep_value(self, value):
|
def get_prep_value(self, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user