Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#13455 closed Uncategorized (fixed)

QuerySet Values() interaction with Extra(select={}) not documented

Reported by: Joshua Russo Owned by: Joshua Russo
Component: Documentation Version: dev
Severity: Normal Keywords: queryset extra select values values_list
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The behavior of Values() method being applied to the Extra(select={}) columns is not obvious or documented. This is confusing since it is not applied to the Aggregate() or Annotate() columns.

I am submitting a small update to the docs to indicate that Extra(select) must be placed before the call to Values() and the extra fields must also be within the list of Values() fields.

Personally I think that it would be better to have the Extra(select={}) either behave like the Aggregate() or Annotate() methods, or even be allowed to take precedence over the actual table columns (since they are being described explicitly). I opted against submitting a patch to accomplish this when I saw that the existing tests where written with the full awareness of the current behavior, and thus a decision must have been made by someone more important than I that this is the way it should work.

Attachments (1)

queryset_extra_w_values_doc.diff (714 bytes ) - added by Joshua Russo 15 years ago.
Added a note about the interaction between Extra(select=...) and Values()/Values_list()

Download all attachments as: .zip

Change History (12)

by Joshua Russo, 15 years ago

Added a note about the interaction between Extra(select=...) and Values()/Values_list()

comment:1 by Joshua Russo, 15 years ago

milestone: 1.31.2

Can this be in the 1.2 milestone?

comment:2 by anonymous, 15 years ago

Component: UncategorizedDocumentation

comment:3 by Joshua Russo, 15 years ago

Owner: changed from nobody to Joshua Russo
Status: newassigned

comment:4 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:5 by Russell Keith-Magee, 15 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [13145]) Fixed #13455 -- Clarified the interaction of values() and extra(). Thanks to Rupe for the report and draft text.

comment:7 by Russell Keith-Magee, 15 years ago

(In [13151]) [1.1.X] Fixed #13455 -- Clarified the interaction of values() and extra(). Thanks to Rupe for the report and draft text.

Backport of r13145 from trunk.

comment:8 by Malcolm Tredinnick, 13 years ago

In [16697]:

Corrected explanation of values() and extra() interaction in querysets.

Fixes #15546, refs #13455. The original documentation patch
inadvertently muddied the waters in one aspect and this commit tidies
that up.

comment:9 by Joshua Russo, 13 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

There's a small typo in mtredinnick's correction, but I don't think I can adjust a changeset.

I believe the last sentance should be "...call will have its..." instead of "...call with have its..."

comment:10 by Aymeric Augustin, 13 years ago

I've created a new ticket, #16712, in case Malcolm doesn't see this comment.

comment:11 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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