Opened 9 years ago

Closed 9 years ago

#26145 closed Cleanup/optimization (fixed)

Made the debug context processor return queries for all databases

Reported by: Sergey Lyapustin Owned by: Mounir
Component: Template system Version: dev
Severity: Normal Keywords: sql_queries
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

sql_queries template variable represents only connections to default database.

context_extras['sql_queries'] = lazy(lambda: connection.queries, list)

https://github.com/django/django/blob/917100eed7ba2f0aca2c1a5b64821c8ba5cc1bcc/django/template/context_processors.py#L46

Expected to represent queries from all connected DB's.

Change History (7)

comment:1 by Sergey Lyapustin, 9 years ago

comment:2 by Tim Graham, 9 years ago

I wonder if there's much value in enhancing that template tag. I think the Django debug toolbar is a better solution these days. Have you tried it?

comment:3 by Sergey Lyapustin, 9 years ago

Yes, sure i use Debug Toolbar as well, but some users like to have simple solution for monitoring app DB's activity.

comment:4 by Tim Graham, 9 years ago

Component: Core (Other)Template system
Summary: Not all SQL Queries included in sql_queries context variableMade the debug context processor return queries for all databases
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization
Version: 1.9master

I'm not enthusiastic about it, but I guess it's fine.

comment:5 by Mounir, 9 years ago

Owner: changed from nobody to Mounir
Status: newassigned

comment:6 by Mounir, 9 years ago

Has patch: set
Last edited 9 years ago by Mounir (previous) (diff)

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 03e1cc93:

Fixed #26145 -- Made debug context processor return queries for all databases.

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