aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/sql.py
diff options
context:
space:
mode:
authorDavid Cramer2011-03-24 17:48:59 -0700
committerDavid Cramer2011-03-24 17:48:59 -0700
commit85e9976164b3d7746385664506ce6c5409e7e9d8 (patch)
treef7349f054653fa7d6fa5023437ce3c091b01d579 /debug_toolbar/panels/sql.py
parent1212fec3a0df762c2f63a34925e304c49fa7354d (diff)
downloaddjango-debug-toolbar-85e9976164b3d7746385664506ce6c5409e7e9d8.tar.bz2
Fix for infinite math fail :)
Diffstat (limited to 'debug_toolbar/panels/sql.py')
-rw-r--r--debug_toolbar/panels/sql.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py
index dc096c0..258fab8 100644
--- a/debug_toolbar/panels/sql.py
+++ b/debug_toolbar/panels/sql.py
@@ -197,7 +197,8 @@ class SQLDebugPanel(DebugPanel):
(0, 256, 0), # blue
(0, 0, 256), # green
]
- factor = int(256.0/len(self._databases)*2.5)
+ factor = int(256.0/(len(self._databases)*2.5))
+ print factor
for n, db in enumerate(self._databases.itervalues()):
rgb = [0, 0, 0]
color = n % 3
@@ -205,6 +206,7 @@ class SQLDebugPanel(DebugPanel):
nn = color
# XXX: pretty sure this is horrible after so many aliases
while rgb[color] < factor:
+ print rgb[color], factor
nc = min(256 - rgb[color], 256)
rgb[color] += nc
nn += 1