aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/__init__.py
diff options
context:
space:
mode:
authorDavid Cramer2012-01-12 19:13:47 -0800
committerDavid Cramer2012-01-12 19:13:47 -0800
commit01cd08518ded622d3308dd539b00ebbf7012894e (patch)
treea9cca14ff92d4602a51d4999430574587a733d1d /debug_toolbar/panels/__init__.py
parentc4eeef24faa81e7bc64ebfbd72c046f25c7b3381 (diff)
downloaddjango-debug-toolbar-01cd08518ded622d3308dd539b00ebbf7012894e.tar.bz2
pep8
Diffstat (limited to 'debug_toolbar/panels/__init__.py')
-rw-r--r--debug_toolbar/panels/__init__.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py
index b4f11fb..f1751d8 100644
--- a/debug_toolbar/panels/__init__.py
+++ b/debug_toolbar/panels/__init__.py
@@ -9,41 +9,41 @@ class DebugPanel(object):
"""
# name = 'Base'
# template = 'debug_toolbar/panels/base.html'
- has_content = False # If content returns something, set to true in subclass
-
+ has_content = False # If content returns something, set to true in subclass
+
# We'll maintain a local context instance so we can expose our template
# context variables to panels which need them:
context = {}
-
+
# Panel methods
def __init__(self, context={}):
self.context.update(context)
self.slug = slugify(self.name)
-
+
def dom_id(self):
return 'djDebug%sPanel' % (self.name.replace(' ', ''))
-
+
def nav_title(self):
"""Title showing in toolbar"""
raise NotImplementedError
-
+
def nav_subtitle(self):
"""Subtitle showing until title in toolbar"""
return ''
-
+
def title(self):
"""Title showing in panel"""
raise NotImplementedError
-
+
def url(self):
raise NotImplementedError
-
+
def content(self):
if self.has_content:
context = self.context.copy()
context.update(self.get_stats())
return render_to_string(self.template, context)
-
+
def record_stats(self, stats):
toolbar = DebugToolbarMiddleware.get_current()
panel_stats = toolbar.stats.get(self.slug)
@@ -51,17 +51,17 @@ class DebugPanel(object):
panel_stats.update(stats)
else:
toolbar.stats[self.slug] = stats
-
+
def get_stats(self):
toolbar = DebugToolbarMiddleware.get_current()
return toolbar.stats.get(self.slug, {})
-
+
# Standard middleware methods
def process_request(self, request):
pass
-
+
def process_view(self, request, view_func, view_args, view_kwargs):
pass
-
+
def process_response(self, request, response):
pass