[Django] #28352: values_list documentation doesn't show return type which can be confusing

6 views
Skip to first unread message

Django

unread,
Jun 30, 2017, 10:11:43 AM6/30/17
to django-...@googlegroups.com
#28352: values_list documentation doesn't show return type which can be confusing
------------------------------------------------+------------------------
Reporter: Rich Elmes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
The values() documentation 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 straight
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28352>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 30, 2017, 10:12:07 AM6/30/17
to django-...@googlegroups.com
#28352: values_list documentation doesn't show correct return type which can be
confusing
-------------------------------------+-------------------------------------

Reporter: Rich Elmes | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:1>

Django

unread,
Jun 30, 2017, 10:29:15 AM6/30/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
--------------------------------------+------------------------------------

Reporter: Rich Elmes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* easy: 0 => 1
* stage: Unreviewed => Accepted


Old description:

> The values() documentation 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 straight
> 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.

New description:

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:2>

Django

unread,
Jul 1, 2017, 12:57:06 PM7/1/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Irindu Indeera ):

* owner: nobody => Irindu Indeera
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:3>

Django

unread,
Jul 1, 2017, 12:57:42 PM7/1/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Irindu Indeera ):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:4>

Django

unread,
Jul 11, 2017, 10:57:45 AM7/11/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/8732 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:5>

Django

unread,
Jul 11, 2017, 2:15:32 PM7/11/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.11
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"babe9e64a6172b09e7f70e8d8f01e67f2cb4176d" babe9e64]:
{{{
#!CommitTicketReference repository=""
revision="babe9e64a6172b09e7f70e8d8f01e67f2cb4176d"
Fixed #28352 -- Corrected QuerySet.values_list() return type in docs
examples.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:6>

Django

unread,
Jul 11, 2017, 2:23:14 PM7/11/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.11

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2457c1866ef3586c56bd19aeaa554e78c1ed1875" 2457c18]:
{{{
#!CommitTicketReference repository=""
revision="2457c1866ef3586c56bd19aeaa554e78c1ed1875"
Refs #28352 -- Corrected another QuerySet.values_list() return type in
docs example.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:7>

Django

unread,
Jul 11, 2017, 2:23:58 PM7/11/17
to django-...@googlegroups.com
#28352: QuerySet.values_list() docs documentation doesn't show correct return type
-------------------------------------+-------------------------------------
Reporter: Rich Elmes | Owner: Irindu
Type: | Indeera
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.11

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"fe7b4568255ae1f77c180404631d81ba6b2d996d" fe7b456]:
{{{
#!CommitTicketReference repository=""
revision="fe7b4568255ae1f77c180404631d81ba6b2d996d"
[1.11.x] Fixed #28352 -- Corrected QuerySet.values_list() return type in
docs examples.

Backport of babe9e64a6172b09e7f70e8d8f01e67f2cb4176d and
2457c1866ef3586c56bd19aeaa554e78c1ed1875 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28352#comment:8>

Reply all
Reply to author
Forward
0 new messages