summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Bordage <bordage.bertrand@gmail.com>2016-10-23 19:22:22 (GMT)
committerBertrand Bordage <bordage.bertrand@gmail.com>2016-10-23 19:22:22 (GMT)
commit2cea2cd8917a1f0e60ee86663891d6007141f308 (patch)
tree780ce382d3c1eed6a640ef42e96c1e1e87a0a2c2
parenteef82f8aaacf52f603e657320e74c95580bee545 (diff)
downloaddjango-cachalot-2cea2cd8917a1f0e60ee86663891d6007141f308.zip
django-cachalot-2cea2cd8917a1f0e60ee86663891d6007141f308.tar.gz
django-cachalot-2cea2cd8917a1f0e60ee86663891d6007141f308.tar.bz2
Fixes issue #62.
-rw-r--r--cachalot/transaction.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/cachalot/transaction.py b/cachalot/transaction.py
index 868c60a..8e09c95 100644
--- a/cachalot/transaction.py
+++ b/cachalot/transaction.py
@@ -26,6 +26,9 @@ class AtomicCache(dict):
self.update(data)
def commit(self):
+ # We import this here to avoid a circular import issue.
+ from .utils import _invalidate_tables
+
if self:
self.parent_cache.set_many(
self, cachalot_settings.CACHALOT_TIMEOUT)
@@ -33,8 +36,3 @@ class AtomicCache(dict):
# invalidated in case another transaction occurred in the meantime.
_invalidate_tables(self.parent_cache, self.db_alias,
self.to_be_invalidated)
-
-
-# We import this after AtomicCache to avoid a circular import issue and
-# avoid importing this locally, which degrades performance.
-from .utils import _invalidate_tables