[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
This commit is contained in:
Ramiro Morales 2010-11-11 05:12:05 +00:00
parent 0f065d346d
commit 2778f14660

View File

@ -329,11 +329,11 @@ class DatabaseWrapper(BaseDatabaseWrapper):
'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)",
}
oracle_version = None
def __init__(self, *args, **kwargs):
super(DatabaseWrapper, self).__init__(*args, **kwargs)
self.oracle_version = None
self.features = DatabaseFeatures()
self.ops = DatabaseOperations()
self.client = DatabaseClient(self)
@ -346,9 +346,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
def _connect_string(self):
settings_dict = self.settings_dict
if len(settings_dict['HOST'].strip()) == 0:
if settings_dict['HOST'].strip():
settings_dict['HOST'] = 'localhost'
if len(settings_dict['PORT'].strip()) != 0:
if settings_dict['PORT'].strip():
dsn = Database.makedsn(settings_dict['HOST'],
int(settings_dict['PORT']),
settings_dict['NAME'])