diff options
Diffstat (limited to 'debug_toolbar')
| -rw-r--r-- | debug_toolbar/static/debug_toolbar/js/toolbar.js | 6 | ||||
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/base.html | 4 | ||||
| -rw-r--r-- | debug_toolbar/toolbar.py | 16 | ||||
| -rw-r--r-- | debug_toolbar/views.py | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 3525f31..6b5dffd 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -27,12 +27,12 @@ } else { $('.panelContent').hide(); // Hide any that are already open var inner = current.find('.djDebugPanelContent .scroll'), - storage_id = $('#djDebug').data('storage-id'), + store_id = $('#djDebug').data('store-id'), render_panel_url = $('#djDebug').data('render-panel-url'); - if (storage_id !== '' && inner.children().length === 0) { + if (store_id !== '' && inner.children().length === 0) { var ajax_data = { data: { - storage_id: storage_id, + store_id: store_id, panel_id: this.className }, type: 'GET', diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 59e50a4..119e713 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -9,7 +9,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/li <script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script> <script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script> <div id="djDebug" style="display:none;" dir="ltr" - data-storage-id="{{ toolbar.storage_id }}" data-render-panel-url="{% url 'djdt:render_panel' %}" + data-store-id="{{ toolbar.store_id }}" data-render-panel-url="{% url 'djdt:render_panel' %}" {{ toolbar.config.ROOT_TAG_ATTRS|safe }}> <div style="display:none;" id="djDebugToolbar"> <ul id="djDebugPanelList"> @@ -53,7 +53,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/li </div> <div class="djDebugPanelContent"> <div class="scroll"> - {% if not toolbar.storage_id %}{{ panel.content }}{% endif %} + {% if not toolbar.store_id %}{{ panel.content }}{% endif %} </div> </div> </div> diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py index ca6d1b4..57ded5b 100644 --- a/debug_toolbar/toolbar.py +++ b/debug_toolbar/toolbar.py @@ -30,7 +30,7 @@ class DebugToolbar(object): panel_instance = panel_class(self, context=self.template_context) self._panels[panel_instance.panel_id] = panel_instance self.stats = {} - self.storage_id = None + self.store_id = None # Manage panels @@ -67,7 +67,7 @@ class DebugToolbar(object): # Handle storing toolbars in memory and fetching them later on - _storage = SortedDict() + _store = SortedDict() def should_render_panels(self): render_panels = self.config['RENDER_PANELS'] @@ -76,17 +76,17 @@ class DebugToolbar(object): return render_panels def store(self): - self.storage_id = uuid.uuid4().hex + self.store_id = uuid.uuid4().hex cls = type(self) - cls._storage[self.storage_id] = self - for _ in range(len(cls._storage) - self.config['RESULTS_CACHE_SIZE']): + cls._store[self.store_id] = self + for _ in range(len(cls._store) - self.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]] + del cls._store[cls._store.keyOrder[0]] @classmethod - def fetch(cls, storage_id): - return cls._storage.get(storage_id) + def fetch(cls, store_id): + return cls._store.get(store_id) # Manually implement class-level caching of panel classes and url patterns # because it's more obvious than going through an abstraction. diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index 109c87a..d46a74e 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -9,7 +9,7 @@ from debug_toolbar.toolbar import DebugToolbar def render_panel(request): """Render the contents of a panel""" - toolbar = DebugToolbar.fetch(request.GET['storage_id']) + toolbar = DebugToolbar.fetch(request.GET['store_id']) if toolbar is None: content = _("Data for this panel isn't available anymore. " "Please reload the page and retry.") |
