diff options
| author | Aymeric Augustin | 2013-11-24 17:30:49 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-24 17:30:49 +0100 | 
| commit | 57a6e261c2768503e1401f99cefd4470c8dc5e8f (patch) | |
| tree | ad0f1553d0155988701b1d63f0f4438ae127bcab /debug_toolbar/panels/cache.py | |
| parent | 3d72c1fa927f129b2a79ea3496cce3262516705b (diff) | |
| download | django-debug-toolbar-57a6e261c2768503e1401f99cefd4470c8dc5e8f.tar.bz2 | |
Update all panels to follow the public API.
Diffstat (limited to 'debug_toolbar/panels/cache.py')
| -rw-r--r-- | debug_toolbar/panels/cache.py | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index c2808a1..d08723f 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -131,9 +131,7 @@ class CachePanel(Panel):      """      Panel that displays the cache statistics.      """ -    name = 'Cache'      template = 'debug_toolbar/panels/cache.html' -    has_content = True      def __init__(self, *args, **kwargs):          super(CachePanel, self).__init__(*args, **kwargs) @@ -183,9 +181,11 @@ class CachePanel(Panel):              'backend': backend          }) -    def nav_title(self): -        return _('Cache') +    # Implement the Panel API +    nav_title = _('Cache') + +    @property      def nav_subtitle(self):          cache_calls = len(self.calls)          return ungettext('%(cache_calls)d call in %(time).2fms', @@ -193,6 +193,7 @@ class CachePanel(Panel):                           cache_calls) % {'cache_calls': cache_calls,                                           'time': self.total_time} +    @property      def title(self):          count = len(getattr(settings, 'CACHES', ['default']))          return ungettext('Cache calls from %(count)d backend', | 
