Skip to content

Commit

Permalink
Fixed small multi-db compatibility issue in the Oracle backend.
Browse files Browse the repository at this point in the history
Also, converted a couple of constructs to a more Python idiomatic form.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14512 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
ramiro committed Nov 11, 2010
1 parent f91b41f commit 4fb1825
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django/db/backends/oracle/base.py
Expand Up @@ -332,11 +332,11 @@ class DatabaseWrapper(BaseDatabaseWrapper):
'istartswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)", 'istartswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)",
'iendswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)", 'iendswith': "LIKE UPPER(TRANSLATE(%s USING NCHAR_CS)) ESCAPE TRANSLATE('\\' USING NCHAR_CS)",
} }
oracle_version = None


def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DatabaseWrapper, self).__init__(*args, **kwargs) super(DatabaseWrapper, self).__init__(*args, **kwargs)


self.oracle_version = None
self.features = DatabaseFeatures(self) self.features = DatabaseFeatures(self)
self.ops = DatabaseOperations() self.ops = DatabaseOperations()
self.client = DatabaseClient(self) self.client = DatabaseClient(self)
Expand All @@ -349,9 +349,9 @@ def _valid_connection(self):


def _connect_string(self): def _connect_string(self):
settings_dict = self.settings_dict settings_dict = self.settings_dict
if len(settings_dict['HOST'].strip()) == 0: if settings_dict['HOST'].strip():
settings_dict['HOST'] = 'localhost' settings_dict['HOST'] = 'localhost'
if len(settings_dict['PORT'].strip()) != 0: if settings_dict['PORT'].strip():
dsn = Database.makedsn(settings_dict['HOST'], dsn = Database.makedsn(settings_dict['HOST'],
int(settings_dict['PORT']), int(settings_dict['PORT']),
settings_dict['NAME']) settings_dict['NAME'])
Expand Down

0 comments on commit 4fb1825

Please sign in to comment.