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
|
return res
|
||||||
Database.convertVariantToPython = variantToPython
|
Database.convertVariantToPython = variantToPython
|
||||||
|
|
||||||
try:
|
class DatabaseWrapper(object):
|
||||||
# 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, settings):
|
def __init__(self, settings):
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
@ -50,14 +50,8 @@ class MysqlDebugWrapper:
|
|||||||
else:
|
else:
|
||||||
return getattr(self.cursor, attr)
|
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):
|
def __init__(self, settings):
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
@ -13,14 +13,7 @@ except ImportError, e:
|
|||||||
|
|
||||||
DatabaseError = Database.Error
|
DatabaseError = Database.Error
|
||||||
|
|
||||||
try:
|
class DatabaseWrapper(object):
|
||||||
# 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, settings):
|
def __init__(self, settings):
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
@ -13,14 +13,7 @@ except ImportError, e:
|
|||||||
|
|
||||||
DatabaseError = Database.DatabaseError
|
DatabaseError = Database.DatabaseError
|
||||||
|
|
||||||
try:
|
class DatabaseWrapper(object):
|
||||||
# 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, settings):
|
def __init__(self, settings):
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
@ -13,20 +13,14 @@ except ImportError, e:
|
|||||||
|
|
||||||
DatabaseError = Database.DatabaseError
|
DatabaseError = Database.DatabaseError
|
||||||
|
|
||||||
try:
|
class DatabaseWrapper(object):
|
||||||
# Only exists in Python 2.4+
|
def __init__(self, settings):
|
||||||
from threading import local
|
self.settings = settings
|
||||||
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):
|
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.queries = []
|
self.queries = []
|
||||||
|
|
||||||
def cursor(self):
|
def cursor(self):
|
||||||
from django.conf import settings
|
settings = self.settings
|
||||||
if self.connection is None:
|
if self.connection is None:
|
||||||
if settings.DATABASE_NAME == '':
|
if settings.DATABASE_NAME == '':
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
Loading…
x
Reference in New Issue
Block a user