Делаю по документации.
В модели:
mptt.register(Topic, order_insertion_by=['title'])
В шаблоне:
<font color="black">{% load mptt_tags %} <br/>
<font color="#0000ff"><</font><font color="#800000">ul</font> <font color="#ff0000">class</font><font color="#0000ff">="replies-list"</font><font color="#0000ff">></font><br/>
{% recursetree replies %}<br/>
<font color="#0000ff"><</font><font color="#800000">li</font><font color="#0000ff">></font><br/>
<font color="#0000ff"><</font><font color="#800000">div</font> <font color="#ff0000">class</font><font color="#0000ff">="comment-id"</font><font color="#0000ff">></font>{{ node.id }}<font color="#0000ff"></</font><font color="#800000">div</font><font color="#0000ff">></font><br/>
<font color="#0000ff"><</font><font color="#800000">p</font> <font color="#ff0000">class</font><font color="#0000ff">="comment-title"</font><font color="#0000ff">></font><br/>
{% if node.image %}<br/>
<font color="#0000ff"><</font><font color="#800000">img</font> <font color="#ff0000">src</font><font color="#0000ff">="{{ node.image }}"</font> <font color="#ff0000">class</font><font color="#0000ff">="fl"</font> <font color="#ff0000">alt</font><font color="#0000ff">=""</font> <font color="#0000ff">/></font><br/>
{% endif %}<br/>
{{ node.title }} <br/>
<font color="#0000ff"><</font><font color="#800000">span</font> <font color="#ff0000">class</font><font color="#0000ff">="date"</font><font color="#0000ff">></font> posted: {%if 'week' in node.created|timesince %} {{ node.created|date:"d-m-Y H:i" }} {% else %} {{ node.created|timesince }} ago {% endif %}<font color="#0000ff"></</font><font color="#800000">span</font><font color="#0000ff">></font><br/>
<font color="#0000ff"><</font><font color="#800000">div</font> <font color="#ff0000">class</font><font color="#0000ff">="clear"</font><font color="#0000ff">></font><font color="#ff0000"> </font><font color="#0000ff"></</font><font color="#800000">div</font><font color="#0000ff">></font><br/>
<font color="#0000ff"></</font><font color="#800000">p</font><font color="#0000ff">></font><br/>
<font color="#0000ff"><</font><font color="#800000">p</font> <font color="#ff0000">class</font><font color="#0000ff">="comment-text"</font><font color="#0000ff">></font>{{ node.text }}<font color="#0000ff"></</font><font color="#800000">p</font><font color="#0000ff">></font><br/>
<font color="#0000ff"><</font><font color="#800000">p</font> <font color="#ff0000">class</font><font color="#0000ff">="comment-reply"</font><font color="#0000ff">><</font><font color="#800000">a</font> <font color="#ff0000">href</font><font color="#0000ff">="#"</font> <font color="#ff0000">class</font><font color="#0000ff">="reply-link"</font><font color="#0000ff">></font>reply<font color="#0000ff"></</font><font color="#800000">a</font><font color="#0000ff">></</font><font color="#800000">p</font><font color="#0000ff">></font> <br/>
{% if not node.is_leaf_node %}<br/>
<font color="#0000ff"><</font><font color="#800000">ul</font> <font color="#ff0000">class</font><font color="#0000ff">="children"</font><font color="#0000ff">></font><br/>
{{ children }}<br/>
<font color="#0000ff"></</font><font color="#800000">ul</font><font color="#0000ff">></font><br/>
{% endif %}<br/>
<font color="#0000ff"></</font><font color="#800000">li</font><font color="#0000ff">></font><br/>
{% endrecursetree %}<br/>
<font color="#0000ff"></</font><font color="#800000">ul</font><font color="#0000ff">></font></font><br/>
<br/>
<font color="gray">* This source code was highlighted with <a href="http://virtser.net/blog/post/source-code-highlighter.aspx"><font color="gray">Source Code Highlighter</font></a>.</font>
В базе все нормально создается, иерархия правильная.
Но в результате выводит пустой список дочерних узлов:
<font color="black"><font color="#0000ff"><</font><font color="#800000">ul</font> <font color="#ff0000">class</font><font color="#0000ff">="children"</font><font color="#0000ff">></font> <font color="#0000ff"></</font><font color="#800000">ul</font><font color="#0000ff">></font></font><br/>
<br/>
<font color="gray">* This source code was highlighted with <a href="http://virtser.net/blog/post/source-code-highlighter.aspx"><font color="gray">Source Code Highlighter</font></a>.</font>
node.is_leaf_node = False, т.е. все правильно, и это не лист. Подскажите что может быть не так?