diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-12 21:55:19 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-12 21:55:19 +0000 |
| commit | 30c846bf3d086acee8dbc1164abdca718a9f19d3 (patch) | |
| tree | da42d9331e96ffc33c986d054637c4d0386dcd36 /django | |
| parent | e1ba9111ac7ae0a625adc467712e86a9e8000570 (diff) | |
Fixed #6669 -- Ensured database connections are marked as dirty by CursorDebugWrapper.execute/executemany. Refs #9964. Thanks james at 10gic net for the report and Claude Paroz for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17368 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/util.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/db/backends/util.py b/django/db/backends/util.py index b0463b79af..3ba1cb00cd 100644 --- a/django/db/backends/util.py +++ b/django/db/backends/util.py @@ -16,9 +16,12 @@ class CursorWrapper(object): self.cursor = cursor self.db = db - def __getattr__(self, attr): + def set_dirty(self): if self.db.is_managed(): self.db.set_dirty() + + def __getattr__(self, attr): + self.set_dirty() if attr in self.__dict__: return self.__dict__[attr] else: @@ -31,6 +34,7 @@ class CursorWrapper(object): class CursorDebugWrapper(CursorWrapper): def execute(self, sql, params=()): + self.set_dirty() start = time() try: return self.cursor.execute(sql, params) @@ -47,6 +51,7 @@ class CursorDebugWrapper(CursorWrapper): ) def executemany(self, sql, param_list): + self.set_dirty() start = time() try: return self.cursor.executemany(sql, param_list) |
