mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
boulder-oracle-sprint: Fixed #3721 with Ben Khoo's patch for working around
LazyDate in Oracle. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4727 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e1d2422cfd
commit
1c6eeb2dda
@ -77,6 +77,7 @@ class FormatStylePlaceholderCursor(Database.Cursor):
|
||||
you'll need to use "%%s".
|
||||
"""
|
||||
def _rewrite_args(self, query, params=None):
|
||||
from django.db.models import LazyDate
|
||||
if params is None:
|
||||
params = []
|
||||
else:
|
||||
@ -87,6 +88,8 @@ class FormatStylePlaceholderCursor(Database.Cursor):
|
||||
params[i] = param.encode('utf-8')
|
||||
except UnicodeError:
|
||||
params[i] = str(param)
|
||||
if type(param) == LazyDate:
|
||||
params[i] = param.__get_value__()
|
||||
args = [(':arg%d' % i) for i in range(len(params))]
|
||||
query = query % tuple(args)
|
||||
# cx_Oracle cannot execute a query with the closing ';'
|
||||
|
Loading…
x
Reference in New Issue
Block a user