Re: Help with getting connection.queries info

2006-11-30 Thread JP
Eric Floehr schrieb: > from django.db import connection > class Logging: > def process_response(self, request, response): > for query in connection.queries: > print "[%s] %s" % (query['time'], " > ".join(query['sql'].split())) > return response > > Which results

Re: Help with getting connection.queries info

2006-11-30 Thread Eric Floehr
Thanks James, that did the trick. For others that may be looking, here is my solution: In my settings file I added below the middleware setting: if DEBUG: MIDDLEWARE_CLASSES += ('web.middleware.Logging',) and in a file called "middleware.py" in my project directory (/web): from django.db

Re: Help with getting connection.queries info

2006-11-29 Thread Tom Smith
I have a similar solution/problem... Firstly, my "solution" was to create a method in my vews.py like this... def my_render(request, template, dict): url_time = 0 try: for query in connection.queries: log( query['time'] + "\t" +

Re: Help with getting connection.queries info

2006-11-28 Thread Eric Floehr
Thanks James, that makes sense! I think I still have a problem though...I was trying a simple example of a problem I am having. I wanted to create a page that would show all the queries and their times, for performance checking. So I would do various things on the website, which would get