#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)
Change History (12)
by , 16 years ago
| Attachment: | queryset_extra_w_values_doc.diff added |
|---|
comment:2 by , 16 years ago
| Component: | Uncategorized → Documentation |
|---|
comment:3 by , 16 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:4 by , 16 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:5 by , 16 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:6 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:7 by , 16 years ago
comment:9 by , 14 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 , 14 years ago
I've created a new ticket, #16712, in case Malcolm doesn't see this comment.
Added a note about the interaction between Extra(select=...) and Values()/Values_list()