From 1930b899bd69fb084856257598ab5ddd8ee4e016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Mon, 13 Aug 2012 09:15:20 +0300 Subject: [PATCH] Refix #13844 -- Made FloatField aggregates work on Python 2.6 + Postgres Fixed a regression introduced in 59a655988ee95e4b4e4646cebea88b620d8fcdd2. --- django/db/backends/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 9f64cfc5f0..77033390eb 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -885,6 +885,8 @@ class BaseDatabaseOperations(object): internal_type = field.get_internal_type() if internal_type == 'DecimalField': return value + elif internal_type == 'FloatField': + return float(value) elif (internal_type and (internal_type.endswith('IntegerField') or internal_type == 'AutoField')): return int(value)