Opened 9 years ago
Closed 9 years ago
#27354 closed Bug (invalid)
Incorrect variable name given in tutorial
| 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 (last modified by )
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?>
Change History (2)
comment:1 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The code is correct. The bit you're referring to isn't a variable, it's the name of a named argument and it's parsed by the Django ORM to build a corresponding query.