From 91e25f9ef8a00dcc4af83329ac2f07a08be9a2b6 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Thu, 15 Jan 2009 15:11:28 +0000 Subject: [PATCH] Fixed #10033: In the Oracle backend, restored code lost in the aggregation merge that ensured a datetime object is returned for fields known to be datetimes, even when the time part is all zero. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9747 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/oracle/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/db/backends/oracle/query.py b/django/db/backends/oracle/query.py index ad9cd47d19..8563420d7f 100644 --- a/django/db/backends/oracle/query.py +++ b/django/db/backends/oracle/query.py @@ -87,7 +87,9 @@ def query_class(QueryClass, Database): value = datetime.datetime(value.year, value.month, value.day, value.hour, value.minute, value.second, value.fsecond) - if field and field.get_internal_type() == 'DateField': + if field and field.get_internal_type() == 'DateTimeField': + pass + elif field and field.get_internal_type() == 'DateField': value = value.date() elif field and field.get_internal_type() == 'TimeField' or (value.year == 1900 and value.month == value.day == 1): value = value.time()