diff options
| author | David Cramer | 2012-03-26 16:05:02 -0700 |
|---|---|---|
| committer | David Cramer | 2012-03-26 16:05:02 -0700 |
| commit | 3f321b13ef2c4db1f626143bb472daa22cd60b25 (patch) | |
| tree | 573ad92d031464fd432c03f8f5c4e09bcd4b87d3 /debug_toolbar/panels/cache.py | |
| parent | e2c37c834d10cbb0343753410fb9306fb6e4982a (diff) | |
| parent | 3f2a3bd5486558df1438ad0034883caeeec3166e (diff) | |
| download | django-debug-toolbar-3f321b13ef2c4db1f626143bb472daa22cd60b25.tar.bz2 | |
Merge pull request #266 from jezdez/master
Improved i18n of panels and important fix to logging panel counter
Diffstat (limited to 'debug_toolbar/panels/cache.py')
| -rw-r--r-- | debug_toolbar/panels/cache.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index ace343b..1656932 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -3,7 +3,7 @@ import inspect from django.core import cache from django.core.cache.backends.base import BaseCache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, ungettext from debug_toolbar.panels import DebugPanel @@ -89,7 +89,14 @@ class CacheDebugPanel(DebugPanel): cache.cache = self.cache def nav_title(self): - return _('Cache: %.2fms') % self.cache.total_time + return _('Cache') + + def nav_subtitle(self): + cache_calls = len(self.cache.calls) + return ungettext('%(cache_calls)d call in %(time).2fms', + '%(cache_calls)d calls in %(time).2fms', + cache_calls) % {'cache_calls': cache_calls, + 'time': self.cache.total_time} def title(self): return _('Cache Usage') |
