Kaydet (Commit) 5f919b9c authored tarafından Tim Graham's avatar Tim Graham

Fixed #23094 -- Removed redundant argument in select_related() example.

Thanks thegeekofalltrades at gmail.com for the report.
üst 99cd80dc
...@@ -762,9 +762,8 @@ following models:: ...@@ -762,9 +762,8 @@ following models::
# ... # ...
author = models.ForeignKey(Person) author = models.ForeignKey(Person)
...then a call to ``Book.objects.select_related('person', ... then a call to ``Book.objects.select_related('person__city').get(id=4)``
'person__city').get(id=4)`` will cache the related ``Person`` *and* the related will cache the related ``Person`` *and* the related ``City``::
``City``::
b = Book.objects.select_related('person__city').get(id=4) b = Book.objects.select_related('person__city').get(id=4)
p = b.author # Doesn't hit the database. p = b.author # Doesn't hit the database.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment