#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.045bfeeff7d8b4d853b120c34fdbd4ff%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to