{% load i18n mptt_tags %} {% for category, structure in categories|tree_info %} {% if structure.new_level %}{% endfor %} {% empty %} {% endfor %}