1
0
mirror of https://github.com/django/django.git synced 2025-04-01 12:06:43 +00:00

Corrected output of Prefetch.to_attr example.

This commit is contained in:
Sergey Fedoseev 2019-01-31 19:09:08 +05:00 committed by Tim Graham
parent b131f9c79f
commit ba7a420012

View File

@ -3481,7 +3481,7 @@ attribute:
>>> prefetch = Prefetch('choice_set', queryset=voted_choices, to_attr='voted_choices')
>>> Question.objects.prefetch_related(prefetch).get().voted_choices
<QuerySet [<Choice: The sky>]>
[<Choice: The sky>]
>>> Question.objects.prefetch_related(prefetch).get().choice_set.all()
<QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]>