From 1c6eeb2ddab133e1a7dccd36a0cd80a5f4b6b75c Mon Sep 17 00:00:00 2001 From: Boulder Sprinters Date: Wed, 14 Mar 2007 20:43:43 +0000 Subject: 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 --- django/db/backends/oracle/base.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django/db') diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index b323af809c..da52d19b7f 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -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 ';' -- cgit v1.2.1