diff options
| author | Malcolm Tredinnick | 2009-02-18 15:48:12 +1100 | 
|---|---|---|
| committer | Rob Hudson | 2009-03-21 08:29:19 -0700 | 
| commit | 50ec9c1b979abd765e7b0f6d0cfa4e24cff18834 (patch) | |
| tree | 8efec70c44d1b5cf02853a47864061099050423c /debug_toolbar/panels/sql.py | |
| parent | 2ea62a9669eb797b5bca8bb80d750bdb5c7aab37 (diff) | |
| download | django-debug-toolbar-50ec9c1b979abd765e7b0f6d0cfa4e24cff18834.tar.bz2 | |
Fixed "FROM" formatting in SQL panel layout.
We always start a new line for "FROM" now. Previous code was assuming MySQL
quoting of identifiers (MySQL is a bit non-standard in using backquotes) and
was assuming the last thing before the FROM would be a quoted identifier, which
wasn't always true, particularly when extra() is used on querysets.
Signed-off-by: Rob Hudson <rob@cogit8.org>
Diffstat (limited to 'debug_toolbar/panels/sql.py')
| -rw-r--r-- | debug_toolbar/panels/sql.py | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 7396c3a..1aa42f7 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -73,7 +73,7 @@ class SQLDebugPanel(DebugPanel):  def reformat_sql(sql):      sql = sql.replace('`,`', '`, `')      sql = sql.replace('SELECT ', 'SELECT\n\t') -    sql = sql.replace('` FROM ', '`\nFROM\n\t') +    sql = sql.replace(' FROM ', '\nFROM\n\t')      sql = sql.replace(' WHERE ', '\nWHERE\n\t')      sql = sql.replace(' INNER JOIN ', '\nINNER JOIN\n\t')      sql = sql.replace(' LEFT OUTER JOIN ', '\nLEFT OUTER JOIN\n\t') | 
