#27354: Incorrect variable name given in tutorial
--------------------------------+--------------------------------------
     Reporter:  arcanemachine   |                    Owner:  nobody
         Type:  Bug             |                   Status:  new
    Component:  Documentation   |                  Version:  1.10
     Severity:  Normal          |               Resolution:
     Keywords:  tutorial, 1.10  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  1               |                    UI/UX:  0
--------------------------------+--------------------------------------
Changes (by arcanemachine):

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


Old description:

> Bug found here: https://docs.djangoproject.com/en/1.10/intro/tutorial02/
>

> On part 2 (Databases) of the Django tutorial v1.10, the following line is
> given:
>
> {{{>>> Choice.objects.filter(question__pub_date__year=current_year)}}}
>

> However, the variable was created as {{{pub_date__year}}} (not
> {{{question__pub_date__year}}}) in a previous section of the same page:
>
> {{{from django.utils import timezone}}}
> {{{current_year = timezone.now().year}}}
> {{{Question.objects.get(pub_date__year=current_year)}}}
> {{{<Question: What's up?>}}}

New description:

 Bug found here: https://docs.djangoproject.com/en/1.10/intro/tutorial02/


 On part 2 (Databases) of the Django tutorial v1.10, the following line is
 given:

 {{{>>> Choice.objects.filter(question__pub_date__year=current_year)}}}


 However, the variable was created as {{{pub_date__year}}} (not
 {{{question__pub_date__year}}}) in a previous section of the same page:

 {{{
 # Get the question that was published this year.
 >>> from django.utils import timezone
 >>> current_year = timezone.now().year
 >>> Question.objects.get(pub_date__year=current_year)
 <Question: What's up?>
 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27354#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/071.f290eb781ac709f6d01240011da8cb35%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to