Opened 13 years ago
Closed 13 years ago
#17537 closed Uncategorized (worksforme)
Writing your first Django app, part 4 - Generic Views - Update to index.html needed
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
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
I could only get the Generic Views to work after I gave the detail view a name 'poll_details' in the urlpatterns and updated index.html to have line:
<li><a href="{% url poll_details pk=poll.id %}">{{ poll.id }}. {{ poll.question }}</a></li>
Note:
See TracTickets
for help on using tickets.
I just built up this tutorial, and it runs just fine leaving the link in index.html as so:
As the url reversal template tag isn't even introduced in the "first Django app" tut, I think it may be better to leave as is. The extra step you took is, as they say, an exercise for the reader.