(commentlist, comment)
return datas
获得当前评论子评论的列表
        用法: {% parse_commenttree article_comments comment as childcomments %}
获得当前评论子评论的列表
        用法: {% parse_commenttree article_comments comment as childcomments %}
获得当前评论子评论的列表 用法 : { % parse_commenttree article_comments comment as childcomments % }
def parse_commenttree(commentlist, comment):
    """获得当前评论子评论的列表
        用法: {% parse_commenttree article_comments comment as childcomments %}
    """
    datas = []

    def parse(c):
        childs = commentlist.filter(parent_comment=c, is_enable=True)
        for child in childs:
            datas.append(child)
            parse(child)

    parse(comment)
    return datas
def parse_commenttree ( commentlist , comment ) : datas = [ ] def parse ( c ) : childs = commentlist . filter ( parent_comment = c , is_enable = True ) for child in childs : datas . append ( child ) parse ( child ) parse ( comment ) return datas