Monday, January 31, 2011

Re: tutorial part 4: ImportError

Hi group,

I've noticed a few things in the tutorial documentation for 1.2 on page http://docs.djangoproject.com/en/1.2/intro/tutorial04/ under the section "Use generic views: Less code is better":

1.  It instructs the user to rename both the detail.html and list.html pages to poll_*.html, but it doesn't say to rename the results.html file to poll_results.html, which in turn in polls/urls.py, the template_name='polls/results.html' seems to need to be changed to template_name='polls/poll_results.html' to be properly used by the generic views. 

2. Also, in polls/views.py, in the vote model, poll_id needs to be changed to object_id in the signature, although the instructions only say to change these references in the templates and in the render_to_response call (it may have been implied to change the vote model signature when the author says that 'The object_detail() generic view expects the ID value captured from the URL to be called "object_id", so we've changed poll_id to object_id for the generic views.', - if this is the case then ignore this one :) 

3. Also in polls/urls.py in the import line "from django.conf.urls.defaults import *" seems to be an unused import

Can someone check to make sure that I am correct on this list?  Maybe I am off-base on some of this.  Thank you!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment