From 1b685252146aec3345adb7d2dec6d9f3173db678 Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Tue, 29 Sep 2009 12:10:49 +1300 Subject: Template panel: One letter variable names are bad practice, changed to use some more informative variable names. Signed-off-by: Rob Hudson --- debug_toolbar/panels/template.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'debug_toolbar/panels/template.py') diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index cc3b1e1..642cd3c 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -65,24 +65,24 @@ class TemplateDebugPanel(DebugPanel): ] ) template_context = [] - for i, d in enumerate(self.templates): + for template_data in self.templates: info = {} # Clean up some info about templates - t = d.get('template', None) + template = template_data.get('template', None) # Skip templates that we are generating through the debug toolbar. - if t.name.startswith('debug_toolbar/'): + if template.name.startswith('debug_toolbar/'): continue - if t.origin and t.origin.name: - t.origin_name = t.origin.name + if template.origin and template.origin.name: + template.origin_name = template.origin.name else: - t.origin_name = 'No origin' - info['template'] = t + template.origin_name = 'No origin' + info['template'] = template # Clean up context for better readability if getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('SHOW_TEMPLATE_CONTEXT', True): - c = d.get('context', None) + context_data = template_data.get('context', None) context_list = [] - for context_layer in c.dicts: + for context_layer in context_data.dicts: for key, value in context_layer.items(): # Replace any request elements - they have a large # unicode representation. The request data is already -- cgit v1.2.3