#23094 closed Cleanup/optimization (fixed)
QuerySet API docs: Sample code doesn't match
Reported by: | Owned by: | Tim Graham | |
---|---|---|---|
Component: | Documentation | Version: | 1.7-beta-2 |
Severity: | Normal | Keywords: | documentation error mismatch match sample |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
On the QuerySet API documentation page, under the section for select_related (https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_related), in the section about following foreign keys, the documentation reads:
"...then a call to Book.objects.select_related('person', 'person__city').get(id=4)
will cache the related Person and the related City:"
and the sample code that follows it reads:
b = Book.objects.select_related('person__city').get(id=4)
The arguments passed to select_related do not match.
The error is present in both the Dev docs and the 1.7 docs.
Change History (4)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In 5f919b9c81a26832f98033335a601ec1ca718db7: