[2.2.x] Corrected output of Prefetch.to_attr example.
Backport of ba7a420012
from master.
This commit is contained in:
parent
89d39dc1d7
commit
6187519236
|
@ -3495,7 +3495,7 @@ attribute:
|
||||||
|
|
||||||
>>> prefetch = Prefetch('choice_set', queryset=voted_choices, to_attr='voted_choices')
|
>>> prefetch = Prefetch('choice_set', queryset=voted_choices, to_attr='voted_choices')
|
||||||
>>> Question.objects.prefetch_related(prefetch).get().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()
|
>>> Question.objects.prefetch_related(prefetch).get().choice_set.all()
|
||||||
<QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]>
|
<QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue