Kaydet (Commit) 4f5f8735 authored tarafından Ian Kelly's avatar Ian Kelly

Fixed #6666: Corrected a bind param formatting issue when performing 'year'…

Fixed #6666: Corrected a bind param formatting issue when performing 'year' lookups on DateFields using Oracle.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 3c504b0f
......@@ -230,9 +230,14 @@ class Field(object):
raise ValueError("The __year lookup type requires an integer argument")
if settings.DATABASE_ENGINE == 'sqlite3':
first = '%s-01-01'
second = '%s-12-31 23:59:59.999999'
elif settings.DATABASE_ENGINE == 'oracle' and self.get_internal_type() == 'DateField':
first = '%s-01-01'
second = '%s-12-31'
else:
first = '%s-01-01 00:00:00'
return [first % value, '%s-12-31 23:59:59.999999' % value]
second = '%s-12-31 23:59:59.999999'
return [first % value, second % value]
raise TypeError("Field has invalid lookup: %s" % lookup_type)
def has_default(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment