Opened 8 years ago

Last modified 8 years ago

#27354 closed Bug

Incorrect variable name given in tutorial — at Initial Version

Reported by: Nick Mow Owned by: nobody
Component: Documentation Version: 1.10
Severity: Normal Keywords: tutorial, 1.10
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

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?>

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top