diff options
| author | Yann Malet | 2011-09-09 23:48:35 +0200 |
|---|---|---|
| committer | Yann Malet | 2011-09-09 23:48:35 +0200 |
| commit | 358d2364f95d859bf75f0194b3ea2b66642f0529 (patch) | |
| tree | 4cd6df9926be4131391f12cda77e9540aa58cee5 /debug_toolbar/panels/cache.py | |
| parent | 7a24088d0d4316e113387d229ed0491e31226348 (diff) | |
| download | django-debug-toolbar-358d2364f95d859bf75f0194b3ea2b66642f0529.tar.bz2 | |
Revert some of the previous changes and modify slightly the panels to separate the gneration of the stats and the generation of the content.
Diffstat (limited to 'debug_toolbar/panels/cache.py')
| -rw-r--r-- | debug_toolbar/panels/cache.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index 5617ec2..c03971d 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -95,11 +95,15 @@ class CacheDebugPanel(DebugPanel): def url(self): return '' - def content(self): - context = self.context.copy() - context.update({ + def process_response(self, request, response): + self.stats = { 'cache_calls': len(self.cache.calls), 'cache_time': self.cache.total_time, 'cache': self.cache, - }) + } + request.debug_toolbar.stats['cache'] = self.stats + + def content(self): + context = self.context.copy() + context.update(self.stats) return render_to_string('debug_toolbar/panels/cache.html', context) |
