diff options
| author | Aymeric Augustin | 2013-10-26 17:44:41 +0200 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-10-26 17:44:41 +0200 | 
| commit | cd1864026c62163c05fe5e22d964884d7b28afaa (patch) | |
| tree | 3aef3a4030dd68f1b9c55e800c0344fcd36ef8d9 /debug_toolbar/views.py | |
| parent | ba9f739620d4955aabf112850122345828402f2b (diff) | |
| download | django-debug-toolbar-cd1864026c62163c05fe5e22d964884d7b28afaa.tar.bz2 | |
Eliminate almost all flake8 messages.
Diffstat (limited to 'debug_toolbar/views.py')
| -rw-r--r-- | debug_toolbar/views.py | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index 53ad3c9..436cb07 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -90,8 +90,18 @@ def sql_profile(request):              cursor.execute("SET PROFILING=1")  # Enable profiling              cursor.execute(sql, params)  # Execute SELECT              cursor.execute("SET PROFILING=0")  # Disable profiling -            # The Query ID should always be 1 here but I'll subselect to get the last one just in case... -            cursor.execute("SELECT * FROM information_schema.profiling WHERE query_id=(SELECT query_id FROM information_schema.profiling ORDER BY query_id DESC LIMIT 1)") +            # The Query ID should always be 1 here but I'll subselect to get +            # the last one just in case... +            cursor.execute(""" +  SELECT  * +    FROM  information_schema.profiling +   WHERE  query_id = ( +          SELECT  query_id +            FROM  information_schema.profiling +        ORDER BY  query_id DESC +           LIMIT  1 +        ) +""")              headers = [d[0] for d in cursor.description]              result = cursor.fetchall()          except Exception: | 
