Commits

Anonymous committed 78d5fdd

[multi-db] Fixed psycopg2 backend. Removed inheritence from local from all backend DatabaseWrappers.

  • Participants
  • Parent commits 26956fc
  • Branches multiple-db-support

Comments (0)

Files changed (5)

File django/db/backends/ado_mssql/base.py

     return res
 Database.convertVariantToPython = variantToPython
 
-try:
-    # Only exists in Python 2.4+
-    from threading import local
-except ImportError:
-    # Import copy of _thread_local.py from Python 2.4
-    from django.utils._threading_local import local
-
-class DatabaseWrapper(local):
+class DatabaseWrapper(object):
     def __init__(self, settings):
         self.settings = settings
         self.connection = None

File django/db/backends/mysql/base.py

         else:
             return getattr(self.cursor, attr)
 
-try:
-    # Only exists in Python 2.4+
-    from threading import local
-except ImportError:
-    # Import copy of _thread_local.py from Python 2.4
-    from django.utils._threading_local import local
 
-class DatabaseWrapper(local):
+class DatabaseWrapper(object):
     def __init__(self, settings):
         self.settings = settings
         self.connection = None

File django/db/backends/oracle/base.py

 
 DatabaseError = Database.Error
 
-try:
-    # Only exists in Python 2.4+
-    from threading import local
-except ImportError:
-    # Import copy of _thread_local.py from Python 2.4
-    from django.utils._threading_local import local
-
-class DatabaseWrapper(local):
+class DatabaseWrapper(object):
     def __init__(self, settings):
         self.settings = settings
         self.connection = None

File django/db/backends/postgresql/base.py

 
 DatabaseError = Database.DatabaseError
 
-try:
-    # Only exists in Python 2.4+
-    from threading import local
-except ImportError:
-    # Import copy of _thread_local.py from Python 2.4
-    from django.utils._threading_local import local
-
-class DatabaseWrapper(local):
+class DatabaseWrapper(object):
     def __init__(self, settings):
         self.settings = settings
         self.connection = None

File django/db/backends/postgresql_psycopg2/base.py

 
 DatabaseError = Database.DatabaseError
 
-try:
-    # Only exists in Python 2.4+
-    from threading import local
-except ImportError:
-    # Import copy of _thread_local.py from Python 2.4
-    from django.utils._threading_local import local
-
-class DatabaseWrapper(local):
-    def __init__(self):
+class DatabaseWrapper(object):
+    def __init__(self, settings):
+        self.settings = settings
         self.connection = None
         self.queries = []
 
     def cursor(self):
-        from django.conf import settings
+        settings = self.settings
         if self.connection is None:
             if settings.DATABASE_NAME == '':
                 from django.core.exceptions import ImproperlyConfigured