From ca777ab08cbadd8fe0f36a3baf69440c5aa9fa6d Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Mon, 19 Jan 2009 20:50:31 +0000 Subject: [PATCH] [1.0.X] Fixed #9275: Extended the Oracle date format to allow DATE columns to be used with DateTimeFields, especially when using legacy databases. Thanks to hollerith for the patch. Backport of [9779] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9780 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/oracle/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index a73f111314..947f5ab949 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -269,7 +269,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): cursor = FormatStylePlaceholderCursor(self.connection) # Set oracle date to ansi date format. This only needs to execute # once when we create a new connection. - cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD' " + cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' " "NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'") try: self.oracle_version = int(self.connection.version.split('.')[0])