[Answer]-Django-mptt does not display "name" attribute

1đź‘Ť

âś…

Found the issue.

In the doc we have the example

<ul class="root">
{% recursetree nodes %}
    <li>
        {{ node.name }}
        {% if not node.is_leaf_node %}
            <ul class="children">
                {{ children }}
            </ul>
        {% endif %}
    </li>
{% endrecursetree %}

node is an instance of our MPTT Model. But it has to be call “nodes”. AND no variable “nodes” should be in your template.

👤Matthieu

Leave a comment