User Accounts
417
The form’s
action
argument includes the
topic_id
value
in the URL,
so the view function can associate the new entry with the correct topic v.
Other than that,
this template looks just like new_topic.html.
Linking to the new_entry Page
Next, we need to include a link to the
new_entry
page
from each topic page
in the topic template:
{% extends "learning_logs/base.html" %}
{% block content %}
Topic: {{ topic }}
Entries:
Add new entry
{% endblock content %}
We place the link to add entries just
before showing the entries, because
adding a new entry will be the most common action on this page. Figure 19-2
shows the
new_entry
page. Now users can add new
topics and as many entries
as they want for each topic. Try out the
new_entry
page
by adding a few entries
to some of the topics you’ve created.
Figure 19-2: The new_entry page
topic.html