Opened 11 years ago
Closed 11 years ago
#22065 closed Uncategorized (worksforme)
Line missing in Tutorial, p.4
Reported by: | profete | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
In the section "Amend views" part 4 of the tutorial on first app on 1.6 (https://docs.djangoproject.com/en/1.6/intro/tutorial04/), I think there is one line missing for the file views.py.
It says:
class IndexView(generic.ListView):
template_name = 'polls/index.html'
context_object_name = 'latest_poll_list'
But, I think the line "model = Poll" is missing. It gives me an error if I don't include it.
Thanks.
Alex
Note:
See TracTickets
for help on using tickets.
Hi,
The
model = Poll
line is not needed because theget_queryset()
method (which is probably what you forgot to add) returnsPoll.objects.order_by(...)
.Thanks.