summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-30 00:18:49 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-30 00:18:49 +0000
commit281f2b74bf19161a0dc5791a07d239ce6a27ed2f (patch)
tree1c37103e4c6bd691c9d564231222e412ad7a6d26 /django
parent1ba2d6888f78ddd280d5882cd31e7253ef143cbc (diff)
Fixed #8023 -- Allow filtering of DecimalFields (in models) using strings.
At the same time, checked all other cases of db_prep_value() to ensure they aren't making the same mistake. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 157c40e832..09d13c417c 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -732,8 +732,8 @@ class DecimalField(Field):
return util.format_number(value, self.max_digits, self.decimal_places)
def get_db_prep_value(self, value):
- return connection.ops.value_to_db_decimal(value, self.max_digits,
- self.decimal_places)
+ return connection.ops.value_to_db_decimal(self.to_python(value),
+ self.max_digits, self.decimal_places)
def get_manipulator_field_objs(self):
return [curry(oldforms.DecimalField, max_digits=self.max_digits, decimal_places=self.decimal_places)]