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

Fixed #9275: Extended the Oracle date format to allow DATE columns to be used…

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 795c229a
...@@ -269,7 +269,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): ...@@ -269,7 +269,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
cursor = FormatStylePlaceholderCursor(self.connection) cursor = FormatStylePlaceholderCursor(self.connection)
# Set oracle date to ansi date format. This only needs to execute # Set oracle date to ansi date format. This only needs to execute
# once when we create a new connection. # 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'") "NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'")
try: try:
self.oracle_version = int(self.connection.version.split('.')[0]) self.oracle_version = int(self.connection.version.split('.')[0])
......
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