Skip to content

Commit

Permalink
Fixed #10033: In the Oracle backend, restored code lost in the aggreg…
Browse files Browse the repository at this point in the history
…ation 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
  • Loading branch information
kmtracey committed Jan 15, 2009
1 parent 14d1509 commit 91e25f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django/db/backends/oracle/query.py
Expand Up @@ -87,7 +87,9 @@ def convert_values(self, value, field):
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()
Expand Down

0 comments on commit 91e25f9

Please sign in to comment.