hiwd
unread,Jun 14, 2008, 12:07:21 AM6/14/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers
Small request, just for debugging purposes...
When viewing the generated sql using django.db.connection.queries
array I want to see the index of the query, the ID if you will, to
help me debug.
Currently, class CursorDebugWrapper's execute method is building the
array of dicts with the keys 'sql' and 'time'.
Locally I added an 'index' key as well...
self.db.queries.append({
'sql': sql,
'time': "%.3f" % (stop - start),
'index': self.db.queries.__len__()
})
so now when I execute:
>>>connection.queries[-1]
>>>{'index': 23, 'time': '0.003', 'sql': u'SELECT...'}
I find it helpful enough, so I thought I'd throw it out there, but ya
know... small request.