#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.b7b29e7f1066064e3f70022e342b950c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.