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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to