{# This template inherits from query.html, replacing its result block with the result block below. #} {% extends "query.html" %} {% block result %}

Your query was: {{ query }}
{# |length is a Jinja filter which returns the number of items in a container. The following if block renders the result's field names. See Jinja's documentation for other potentially useful filters. #} It returned {{ results|length }} records with these fields:
{% if results|length > 0 %} |  {% for col in results[0].keys() %} {{ col }}  |  {% endfor %} {% else %} No records; no fields {% endif %}

{# Render the fields of each record. #} {% for row in results %} |  {% for col in row.values() %} {{ col }} |  {% endfor %}
{% endfor %} {% endblock %}