[Django] #23094: QuerySet API docs: Sample code doesn't match

1 view
Skip to first unread message

Django

unread,
Jul 24, 2014, 12:58:51 PM7/24/14
to django-...@googlegroups.com
#23094: QuerySet API docs: Sample code doesn't match
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
thegeekofalltrades@… | Status: new
Type: Uncategorized | Version: 1.7-beta-2
Component: Documentation | Keywords: documentation error
Severity: Normal | mismatch match sample
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
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.

Pardon the odd formatting on the double underscores. I tried to escape
them in about eight different ways, and this was the best I could do.

--
Ticket URL: <https://code.djangoproject.com/ticket/23094>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 24, 2014, 1:18:03 PM7/24/14
to django-...@googlegroups.com
#23094: QuerySet API docs: Sample code doesn't match
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
thegeekofalltrades@… | Status: new
Type: Uncategorized | Version:
Component: Documentation | 1.7-beta-2
Severity: Normal | Resolution:
Keywords: documentation error | Triage Stage:
mismatch match sample | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0


Old description:

> 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.
>
> Pardon the odd formatting on the double underscores. I tried to escape
> them in about eight different ways, and this was the best I could do.

New description:

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23094#comment:1>

Django

unread,
Jul 24, 2014, 2:04:29 PM7/24/14
to django-...@googlegroups.com
#23094: QuerySet API docs: Sample code doesn't match
-------------------------------------+-------------------------------------
Reporter: | Owner: timo
thegeekofalltrades@… | Status: assigned
Type: | Version:
Cleanup/optimization | 1.7-beta-2
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: documentation error | Needs documentation: 0
mismatch match sample | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by timo):

* owner: nobody => timo
* status: new => assigned
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23094#comment:2>

Django

unread,
Jul 24, 2014, 2:10:52 PM7/24/14
to django-...@googlegroups.com
#23094: QuerySet API docs: Sample code doesn't match
-------------------------------------+-------------------------------------
Reporter: | Owner: timo
thegeekofalltrades@… | Status: closed
Type: | Version:
Cleanup/optimization | 1.7-beta-2
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: documentation error | Needs documentation: 0
mismatch match sample | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"5f919b9c81a26832f98033335a601ec1ca718db7"]:
{{{
#!CommitTicketReference repository=""
revision="5f919b9c81a26832f98033335a601ec1ca718db7"
Fixed #23094 -- Removed redundant argument in select_related() example.

Thanks thegeekofalltrades at gmail.com for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23094#comment:3>

Django

unread,
Jul 24, 2014, 2:10:54 PM7/24/14
to django-...@googlegroups.com
#23094: QuerySet API docs: Sample code doesn't match
-------------------------------------+-------------------------------------
Reporter: | Owner: timo
thegeekofalltrades@… | Status: closed
Type: | Version:
Cleanup/optimization | 1.7-beta-2
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: documentation error | Needs documentation: 0
mismatch match sample | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"5822ca6c108e4cde134e55632dbaf79aeead1777"]:
{{{
#!CommitTicketReference repository=""
revision="5822ca6c108e4cde134e55632dbaf79aeead1777"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23094#comment:4>

Reply all
Reply to author
Forward
0 new messages