Opened 10 years ago

Closed 10 years ago

#24043 closed Bug (invalid)

connection.queries always empty

Reported by: artscoop Owned by: nobody
Component: Database layer (models, ORM) Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,
I am using Django 1.7 (tried 1.7, 1.7.1 and stable/1.7.2), settings.DEBUG is True.
settings.DATABASE has 2 database configurations, one with PostgreSQL and one with SQLite.

connection.queries in views, and sql_queries in templates, are always empty. (tested in Middleware, views and templates)
I've seen https://code.djangoproject.com/ticket/23364 which states a similar (or the same) bug, and says it's fixed.

Yet, connection.queries (or .queries for each connections.all()) is desperately empty.

Change History (2)

comment:1 by Claude Paroz, 10 years ago

If you could reproduce your issue in a sample project, it would be perfect!

comment:2 by artscoop, 10 years ago

Resolution: invalid
Status: newclosed

Just created a blank project, made a view, and there connection.queries is not empty...
And found some code I wrote, explicitly "preventing query logging per view in DEBUG". Code was

if settings.DEBUG:
    BaseDatabaseWrapper.make_debug_cursor = lambda self, cursor: CursorWrapper(cursor, self)

False alarm.

Note: See TracTickets for help on using tickets.
Back to Top