simplify the patch.

This commit is contained in:
benoitc 2012-02-21 14:38:59 +01:00
parent b0c542e80e
commit 52a9e2e9a2

View File

@ -18,21 +18,11 @@ def patch_django():
import thread import thread
_get_ident = thread.get_ident _get_ident = thread.get_ident
def _init(self, settings_dict, alias=DEFAULT_DB_ALIAS, __old__init__ = BaseDatabaseWrapper.__init__
allow_thread_sharing=False):
self.connection = None
self.queries = []
self.settings_dict = settings_dict
self.alias = alias
self.use_debug_cursor = None
# Transaction related attributes def _init(self, *args, **kwargs):
self.transaction_state = [] __old__init__(self, *args, **kwargs)
self.savepoint_state = 0
self._dirty = None
self._thread_ident = _get_ident() self._thread_ident = _get_ident()
self.allow_thread_sharing = allow_thread_sharing
def _validate_thread_sharing(self): def _validate_thread_sharing(self):
if (not self.allow_thread_sharing if (not self.allow_thread_sharing