diff options
| author | Rob Hudson | 2009-08-11 09:45:18 -0700 | 
|---|---|---|
| committer | Rob Hudson | 2009-08-11 09:45:18 -0700 | 
| commit | 565b100f9d97214043ae93c51d276951a65331e8 (patch) | |
| tree | 985e152cd6b10aef47ae64a63f4206d0249c8ca5 /debug_toolbar/panels/sql.py | |
| parent | b5ccbcdfa1b4cc71aec7c289d455298bc5cd1bfb (diff) | |
| download | django-debug-toolbar-565b100f9d97214043ae93c51d276951a65331e8.tar.bz2 | |
Refactored the UI to be a right hand side vertical toolbar. DebugPanel subclass grew a subtitle method to display informative text under the title.
Diffstat (limited to 'debug_toolbar/panels/sql.py')
| -rw-r--r-- | debug_toolbar/panels/sql.py | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index d3ac7f3..d1d1ead 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -74,9 +74,12 @@ class SQLDebugPanel(DebugPanel):          self._sql_time = 0      def title(self): +        return 'SQL' + +    def subtitle(self):          self._sql_time = sum(map(lambda q: float(q['time']), connection.queries))          num_queries = len(connection.queries) - self._offset -        return '%d SQL %s (%.2fms)' % ( +        return "%d %s in %.2fms" % (              num_queries,              (num_queries == 1) and 'query' or 'queries',              self._sql_time | 
