aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/toolbar.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/toolbar.py')
-rw-r--r--debug_toolbar/toolbar.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index 992e4a8..acb86d9 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -4,6 +4,8 @@ The main DebugToolbar class that loads and renders the Toolbar.
from __future__ import unicode_literals
+import uuid
+
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.exceptions import ImproperlyConfigured
@@ -62,7 +64,6 @@ class DebugToolbar(object):
# Handle storing toolbars in memory and fetching them later on
- _counter = 0
_storage = SortedDict()
def should_render_panels(self):
@@ -72,14 +73,14 @@ class DebugToolbar(object):
return render_panels
def store(self):
+ storage_id = uuid.uuid4().hex
cls = type(self)
- cls._counter += 1
- cls._storage[cls._counter] = self
+ cls._storage[storage_id] = self
for _ in range(len(cls._storage) - dt_settings.CONFIG['RESULTS_CACHE_SIZE']):
# When we drop support for Python 2.6 and switch to
# collections.OrderedDict, use popitem(last=False).
del cls._storage[cls._storage.keyOrder[0]]
- return cls._counter
+ return storage_id
@classmethod
def fetch(cls, storage_id):