{% if query.get_page() > 1 %} Previous {% endif %} {% if query.get_pages() > query.get_page() %} Next {% endif %}