Expressed the dirty flag handling logic in terms of autocommit.
This commit is contained in:
parent
cd364efa00
commit
7b4815b455
|
@ -311,6 +311,7 @@ class BaseDatabaseWrapper(object):
|
||||||
to decide in a managed block of code to decide whether there are open
|
to decide in a managed block of code to decide whether there are open
|
||||||
changes waiting for commit.
|
changes waiting for commit.
|
||||||
"""
|
"""
|
||||||
|
if not self.autocommit:
|
||||||
self._dirty = True
|
self._dirty = True
|
||||||
|
|
||||||
def set_clean(self):
|
def set_clean(self):
|
||||||
|
|
|
@ -202,10 +202,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
||||||
level = self.isolation_level
|
level = self.isolation_level
|
||||||
self.connection.set_isolation_level(level)
|
self.connection.set_isolation_level(level)
|
||||||
|
|
||||||
def set_dirty(self):
|
|
||||||
if self.transaction_state and self.transaction_state[-1]:
|
|
||||||
super(DatabaseWrapper, self).set_dirty()
|
|
||||||
|
|
||||||
def check_constraints(self, table_names=None):
|
def check_constraints(self, table_names=None):
|
||||||
"""
|
"""
|
||||||
To check constraints, we set constraints to immediate. Then, when, we're done we must ensure they
|
To check constraints, we set constraints to immediate. Then, when, we're done we must ensure they
|
||||||
|
|
Loading…
Reference in New Issue