Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed small multi-db compatibility issue in the Oracle backend.

Also, converted a couple of constructs to a more Python idiomatic form.

Backport of [14512] from trunk

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2778f146604f33c4eab316ce6c8566a83b198ea8 1 parent 0f065d3
Ramiro Morales authored November 11, 2010

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/db/backends/oracle/base.py
6  django/db/backends/oracle/base.py
@@ -329,11 +329,11 @@ class DatabaseWrapper(BaseDatabaseWrapper):
329 329
         'istartswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)",
330 330
         'iendswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)",
331 331
     }
332  
-    oracle_version = None
333 332
 
334 333
     def __init__(self, *args, **kwargs):
335 334
         super(DatabaseWrapper, self).__init__(*args, **kwargs)
336 335
 
  336
+        self.oracle_version = None
337 337
         self.features = DatabaseFeatures()
338 338
         self.ops = DatabaseOperations()
339 339
         self.client = DatabaseClient(self)
@@ -346,9 +346,9 @@ def _valid_connection(self):
346 346
 
347 347
     def _connect_string(self):
348 348
         settings_dict = self.settings_dict
349  
-        if len(settings_dict['HOST'].strip()) == 0:
  349
+        if settings_dict['HOST'].strip():
350 350
             settings_dict['HOST'] = 'localhost'
351  
-        if len(settings_dict['PORT'].strip()) != 0:
  351
+        if settings_dict['PORT'].strip():
352 352
             dsn = Database.makedsn(settings_dict['HOST'],
353 353
                                    int(settings_dict['PORT']),
354 354
                                    settings_dict['NAME'])

0 notes on commit 2778f14

Please sign in to comment.
Something went wrong with that request. Please try again.