mirror of
https://github.com/django/django.git
synced 2025-04-18 06:14:37 +00:00
[1.7.x] Fixed #23094 -- Removed redundant argument in select_related() example.
Thanks thegeekofalltrades at gmail.com for the report. Backport of 5f919b9c81 from master
This commit is contained in:
parent
0f8e8c86dd
commit
5822ca6c10
@ -766,9 +766,8 @@ following models::
|
||||
# ...
|
||||
author = models.ForeignKey(Person)
|
||||
|
||||
...then a call to ``Book.objects.select_related('person',
|
||||
'person__city').get(id=4)`` will cache the related ``Person`` *and* the related
|
||||
``City``::
|
||||
... then a call to ``Book.objects.select_related('person__city').get(id=4)``
|
||||
will cache the related ``Person`` *and* the related ``City``::
|
||||
|
||||
b = Book.objects.select_related('person__city').get(id=4)
|
||||
p = b.author # Doesn't hit the database.
|
||||
|
Loading…
x
Reference in New Issue
Block a user