django-debug-toolbar/django-debug-toolbar — pull request #224 by Apkawa (2011-10-27 20:34:13+00:00)
Title: Add escaping string literal in sql for copy&pasting in dbshell

as example
before

SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."session_key" = aab0459a9643a891e186d9e5feb97c1d AND "django_session"."expire_date" > 2011-10-27 00:01:37 )
This sql is not valid.

after

SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."session_key" = 'aab0459a9643a891e186d9e5feb97c1d' AND "django_session"."expire_date" > '2011-10-27 00:01:37' )

TODO: monkey-patch method connection().db.ops.last_executed_query