Opened 7 months ago

Closed 6 months ago

Last modified 6 months ago

#28352 closed Cleanup/optimization (fixed)

QuerySet.values_list() docs documentation doesn't show correct return type

Reported by: Rich Elmes Owned by: Irindu Indeera
Component: Documentation Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description (last modified by Tim Graham)

The values() documentation (docs/ref/models/querysets.txt) correctly shows the return type of the object:

>>> Entry.objects.values()
<QuerySet [{'blog_id': 1, 'headline': 'First Entry', ...}, ...]>

whereas the values_list() erroneously shows the return type as a list:

>>> Entry.objects.values_list('id', 'headline')
[(1, 'First entry'), ...]

Simply wrapping <QuerySet> around the list shown might save others getting as confused as I did.

Change History (8)

comment:1 Changed 7 months ago by Rich Elmes

Summary: values_list documentation doesn't show return type which can be confusingvalues_list documentation doesn't show correct return type which can be confusing

comment:2 Changed 7 months ago by Tim Graham

Description: modified (diff)
Easy pickings: set
Summary: values_list documentation doesn't show correct return type which can be confusingQuerySet.values_list() docs documentation doesn't show correct return type
Triage Stage: UnreviewedAccepted

comment:3 Changed 7 months ago by Irindu Indeera

Owner: changed from nobody to Irindu Indeera
Status: newassigned

comment:4 Changed 7 months ago by Irindu Indeera

Hi Tim, I'd Like to work on this issue

comment:5 Changed 6 months ago by Tim Graham

Has patch: set
Patch needs improvement: set
Last edited 6 months ago by Tim Graham (previous) (diff)

comment:6 Changed 6 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In babe9e64:

Fixed #28352 -- Corrected QuerySet.values_list() return type in docs examples.

comment:7 Changed 6 months ago by Tim Graham <timograham@…>

In 2457c18:

Refs #28352 -- Corrected another QuerySet.values_list() return type in docs example.

comment:8 Changed 6 months ago by Tim Graham <timograham@…>

In fe7b456:

[1.11.x] Fixed #28352 -- Corrected QuerySet.values_list() return type in docs examples.

Backport of babe9e64a6172b09e7f70e8d8f01e67f2cb4176d and
2457c1866ef3586c56bd19aeaa554e78c1ed1875 from master

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