#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



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.


Change History (1)

comment:1 Changed 22 months ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed


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(...).


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