From 4fb1825e75999e16027bda73d905d815326bec84 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Thu, 11 Nov 2010 05:07:32 +0000 Subject: [PATCH] Fixed small multi-db compatibility issue in the Oracle backend. 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 --- django/db/backends/oracle/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 5fe12a9f09a..54f1e56d772 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -332,11 +332,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) self.ops = DatabaseOperations() self.client = DatabaseClient(self) @@ -349,9 +349,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'])