The loan maintenance view template is located at /path/to/repo/www/chapter_10/templates/maintenance.html. The first item of interest is how to present the drop-down list of borrowers. The view calls a method, fetchBorrowerKeysAndNames(), from the UserService class, subsequently sent to the template. We are then able to build the HTML SELECT element using the Django template language, as shown here:
<select name="borrowerKey">
{% if borrowerKey and borrowerName %}
<option value="{{ borrowerKey }}">{{ borrowerName }}</option>
{% endif %}
{% for user in borrowers %}
<option value="{{ user.key }}">{{ user.name }}</option>
{% endfor %}
</select>
We also provide the complete payment schedule for the borrower in the same template. This is so that the loan administrator can see which payments have been received. The view extracts the payments list from the loan document and sends it to the template...