{% for d in dates %}
<div class="sort-item">
{{ d.display or d.date }}
<input type="hidden" name="date" value="{{d.id}}">
</div>
{% endfor %}