﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4615	"Part 4 of tutorial leaves ""vote"" view in broken state due to reverse lookup on deleted view"	simeonf@…	Jacob	"When part 4 of the tutorial introduces generic views it breaks the vote method. The last line currently reads 
{{{
return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(p.id,)))
}}}

Once we've switched to generic views, however, the mysite.polls.views.results view is deleted. Voting on a poll now results in an error message
{{{
NoReverseMatch at /polls/2/vote/
}}}
The tutorial does mention changing the vote view to pass the expected generic result set objects. It should also specify that the urls.py file should be modified so that the the results view has a name like
{{{
url(r'^(?P<object_id>\d+)/results/$',
        'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'),
         name=""poll_results""),
}}}
and modify the reverse call to use the named view instead of the site.app.viewname syntax like:
{{{
return HttpResponseRedirect(reverse('poll_results', args=(p.id,)))
}}}

"		closed	Documentation	dev		fixed	tutorial		Ready for checkin	1	0	0	0	0	0
