From 2cf0d659941944acafef97f44563a98b62e2a712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Telepovsk=C3=BD?= Date: Tue, 22 Nov 2016 15:09:39 +0100 Subject: [PATCH] Fixes cache in CachalotPanel, Version 1.4.2 --- CHANGELOG.rst | 5 +++++ benchmark/conditions.rst | 2 +- cachalot/__init__.py | 2 +- cachalot/panels.py | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9a88a2d..e83ea37 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ What’s new in django-cachalot? ============================== +1.4.2 +----- + +- Fixes cache in CachalotPanel + 1.4.1 ----- diff --git a/benchmark/conditions.rst b/benchmark/conditions.rst index 561fe54..f9d5085 100644 --- a/benchmark/conditions.rst +++ b/benchmark/conditions.rst @@ -7,7 +7,7 @@ Disk INTEL SSDSC2CW06 Linux distribution Ubuntu 16.04 xenial Python 3.5.2 Django 1.10.2 -cachalot 1.4.1 +cachalot 1.4.2 sqlite 3.11.0 PostgreSQL 9.6.0 MySQL 5.7.15 diff --git a/cachalot/__init__.py b/cachalot/__init__.py index c17470b..bf42e16 100644 --- a/cachalot/__init__.py +++ b/cachalot/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 4, 1) +VERSION = (1, 4, 2) __version__ = '.'.join(map(str, VERSION)) default_app_config = 'cachalot.apps.CachalotConfig' diff --git a/cachalot/panels.py b/cachalot/panels.py index 505b4bd..8eb2d04 100644 --- a/cachalot/panels.py +++ b/cachalot/panels.py @@ -7,10 +7,10 @@ from datetime import datetime from debug_toolbar.panels import Panel from django.apps import apps from django.conf import settings -from django.core.cache import cache from django.utils.translation import ugettext_lazy as _ from django.utils.timesince import timesince +from .cache import cachalot_caches from .utils import _get_table_cache_key @@ -43,6 +43,7 @@ class CachalotPanel(Panel): def collect_invalidations(self): models = apps.get_models() data = defaultdict(list) + cache = cachalot_caches.get_cache() for db_alias in settings.DATABASES: model_cache_keys = dict( [(_get_table_cache_key(db_alias, model._meta.db_table), model)