{% load custom_tags_and_filters %} {% with order_list=order_by|concat:',-'|concat:order_by %} {# order_list = "name,-name #} {% with order=page.paginator.order_by|cut:order_by|yesno:order_list %} {# order = -name if order_by is name and vice versa #} {# check if we need to call a js function or refresh the current page #} {% if page.paginator.js_callback %} {{ name }} {% else %} {{ name }} {% endif %} {% endwith %} {% endwith %}