A
A
Alexander2016-03-08 10:07:04
Django
Alexander, 2016-03-08 10:07:04

The code from the mptt documentation doesn't quite work. Where to dig?

In the admin panel, the tree is built without problems. (django_mptt_admin)
In the template, code from the mptt documentation:

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

The problem is that only the name of the root category is displayed. The rest are not output,
although node.is_leaf_node returns False, i.e. Root has children.
The problem is somewhere in the work of {{ clildren }}, because there are tags in the answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oscar Django, 2016-03-08
@alesd

{{ clildren }} vs {{ children }}
Isn't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question