Opened 10 years ago

Closed 10 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

Change History (1)

comment:1 by Baptiste Mispelon, 10 years ago

Resolution: worksforme
Status: newclosed

Hi,

The model = Poll line is not needed because the get_queryset() method (which is probably what you forgot to add) returns Poll.objects.order_by(...).

Thanks.

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