In this template,
<body><p>You searched for: <strong>{{ first }} {{ last }}</strong></p>
{% if lawyers %}
<p>There are {{ lawyers|length }} schoolmates of <strong>{{ first }} {{ last }}</strong> in the database:</p>
<ul>
{% for lawyer in lawyers %}
<li> {{ lawyer.first }} {{ lawyer.last }} {{ lawyer.firm_name }} {{ lawyer.school }} {{ lawyer.year_graduated }}</li>
{% endfor %}
</ul>
{% else %}
<p><strong>{{ first }} {{ last }}</strong> has no classmates in the database. Try another lawyer.</p>
{% endif %}
I pick up {{ first }} and {{ last }} from the search form but not the other parameters such as year_graduated.
But I want to be able to say:
<p>You searched for: <strong> {{ first }} {{ last }}, class of {{ year_graduated }} </strong> </p>
How can I use lawyer.year_graduated in the template even though it is not in the search form?
See my previous question for the view function.
Thank you.
Well, the easy way would just be to add year_graduated to the context dict.