diff options
| author | Aymeric Augustin | 2013-11-24 12:57:51 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-24 12:57:51 +0100 |
| commit | edd9d828bbeebc867710d5e078c1b0f8e80dc5b6 (patch) | |
| tree | 32f1962680e39ab573b2e6fa208fd83e4b1a1f94 /debug_toolbar/panels | |
| parent | 6b0d32f7066cac5b6cb92e383eb486a3aa666d03 (diff) | |
| download | django-debug-toolbar-edd9d828bbeebc867710d5e078c1b0f8e80dc5b6.tar.bz2 | |
Removed unneeded Panel.slug attribute.
Diffstat (limited to 'debug_toolbar/panels')
| -rw-r--r-- | debug_toolbar/panels/__init__.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index 1ab500b..5175278 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -25,7 +25,6 @@ class Panel(object): def __init__(self, toolbar, context={}): self.toolbar = toolbar self.context.update(context) - self.slug = slugify(self.name) def content(self): if self.has_content: @@ -69,17 +68,13 @@ class Panel(object): def disable_instrumentation(self): pass - # Store and retrieve stats (shared between panels) + # Store and retrieve stats (shared between panels for no good reason) def record_stats(self, stats): - panel_stats = self.toolbar.stats.get(self.slug) - if panel_stats: - panel_stats.update(stats) - else: - self.toolbar.stats[self.slug] = stats + self.toolbar.stats.setdefault(self.panel_id, {}).update(stats) def get_stats(self): - return self.toolbar.stats.get(self.slug, {}) + return self.toolbar.stats.get(self.panel_id, {}) # Standard middleware methods |
