mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[multi-db] Fixed psycopg2 backend. Removed inheritence from local from all backend DatabaseWrappers.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b87d360a07
commit
eb1357bf48
@ -47,14 +47,7 @@ def variantToPython(variant, adType):
|
||||
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
|
||||
|
@ -50,14 +50,8 @@ class MysqlDebugWrapper:
|
||||
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
|
||||
|
@ -13,14 +13,7 @@ except ImportError, e:
|
||||
|
||||
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
|
||||
|
@ -13,14 +13,7 @@ except ImportError, e:
|
||||
|
||||
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
|
||||
|
@ -13,20 +13,14 @@ except ImportError, e:
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user