Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11302 closed (fixed)

Generic Formset executes unnescesary SQL queries

Reported by: Alex Gaynor Owned by: Brian Rosner
Component: Contrib apps Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In cases where it's passed a new, but unsaved object it still queries the DB for records, which by definition can't exist.

Attachments (1)

generic-formset-optimization.diff (707 bytes) - added by Alex Gaynor 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Alex Gaynor

comment:1 Changed 7 years ago by Alex Gaynor

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to Brian Rosner
Patch needs improvement: unset

comment:2 Changed 7 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

(In [10981]) Fixed #11302 -- Avoid unnesscary (and possibly unintentional) queries/results from generic inline formsets.

When an instance with no primary key value is passed in to a generic inline
formset we ensure no queries/results occur. Thanks Alex Gaynor.

comment:3 Changed 7 years ago by Brian Rosner

(In [10982]) [1.0.X] Fixed #11302 -- Avoid unnesscary (and possibly unintentional) queries/results from generic inline formsets.

When an instance with no primary key value is passed in to a generic inline
formset we ensure no queries/results occur. Thanks Alex Gaynor.

Backport of [10981] from trunk.

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