mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
[1.7.x] Fixed minor syntax error in Queryset docs
Backport of f2eea960e0
from master.
This commit is contained in:
parent
dda6224459
commit
cc8a800d0c
1 changed files with 1 additions and 1 deletions
|
@ -981,7 +981,7 @@ less ambiguous than storing a filtered result in the related manager's cache:
|
||||||
>>>
|
>>>
|
||||||
>>> # Recommended:
|
>>> # Recommended:
|
||||||
>>> restaurants = Restaurant.objects.prefetch_related(
|
>>> restaurants = Restaurant.objects.prefetch_related(
|
||||||
... Prefetch('pizzas', to_attr='vegetarian_pizzas' queryset=queryset))
|
... Prefetch('pizzas', queryset=queryset, to_attr='vegetarian_pizzas'))
|
||||||
>>> vegetarian_pizzas = restaurants[0].vegetarian_pizzas
|
>>> vegetarian_pizzas = restaurants[0].vegetarian_pizzas
|
||||||
>>>
|
>>>
|
||||||
>>> # Not recommended:
|
>>> # Not recommended:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue