Author: ramiro
Date: 2010-11-10 23:07:32 -0600 (Wed, 10 Nov 2010)
New Revision: 14512
Modified:
django/trunk/django/db/backends/oracle/base.py
Log:
Fixed small multi-db compatibility issue in the Oracle backend.
Also, converted a couple of constructs to a more Python idiomatic form.
Modified: django/trunk/django/db/backends/oracle/base.py
===================================================================
--- django/trunk/django/db/backends/oracle/base.py 2010-11-11 04:37:37 UTC
(rev 14511)
+++ django/trunk/django/db/backends/oracle/base.py 2010-11-11 05:07:32 UTC
(rev 14512)
@@ -332,11 +332,11 @@
'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 @@
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'])
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.