dcramer/django-devserver — pull request #66 by acdha (2012-11-07 21:48:03+00:00)
Title: Use Django's last_executed_query to quote SQL

Previously string values were not quoted, causing sqlparse to interpret them
as code. Any value which matched a SQL keyword would be capitalized and
indented, causing garbled display of queries containing text like 'of',
'and', 'key',
'limit', etc.

django.db.backends.BaseDatabaseOperations has a helpful last_executed_query
method which expands query placeholders (django-debug-toolbar also uses this)
reliably. This commit changes the SQL realtime module to use
last_executed_query and to perform the formatting after the actual query
executes to match the expected semantics.

Closes #13