Opened 3 years ago

Last modified 3 years ago

#18631 new New feature

A way to get handle to the generated query for terminal queryset methods

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

Description

When debugging or testing generated ORM queries it is often useful to get a handle to generated queryset from terminal qs methods (like .update() or .aggregate()) instead of executing the query.

The attached proof-of-concept shows a way to achieve this.

Attachments (1)

ticket_18631_poc.diff (2.7 KB) - added by akaariai 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by akaariai

comment:1 Changed 3 years ago by jwmayfield

  • Cc jason@… added
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 3 years ago by jwmayfield

  • Cc jason@… removed
  • Triage Stage changed from Design decision needed to Unreviewed

comment:3 Changed 3 years ago by akaariai

  • Triage Stage changed from Unreviewed to Accepted

I am marking this as accepted.

I am not sure if the attached patch is the right way to do this. But some way to do this would be nice for debugging purposes.

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