On Tue, 2008-07-08 at 17:43 -0700, Peter wrote:
[...]
> Is this Django-MySQL 5.x specific? Is this a full-on django bug?
Neither. Any quoting and escaping of parameters in the query is done by
the Python database wrapper. The DB API does not expose any public
function to access how each individual backend does that quoting, so we
can only show you the values prior to escaping occurring (for all
backends). It's a good approximation, but it's not always perfect for
cut-and-paste use. Pretty easy to modify when you need it, though.
If you want to see the exact query that is being passed through to
cursor.execute() and you're using trunk, have a look at
my_queryset.query.as_sql()
That will return the string (with "%s" where parameters go) and a tuple
of the parameters that are being substituted. That is *exactly* what is
passed to the DB wrapper (MySQLdb, pyscopg2, pysqlite2, etc).
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---