diff --git a/comments/templatetags/comments_tags.py b/comments/templatetags/comments_tags.py deleted file mode 100644 index fde02b4..0000000 --- a/comments/templatetags/comments_tags.py +++ /dev/null @@ -1,30 +0,0 @@ -from django import template - -register = template.Library() - - -@register.simple_tag -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 - - -@register.inclusion_tag('comments/tags/comment_item.html') -def show_comment_item(comment, ischild): - """评论""" - depth = 1 if ischild else 2 - return { - 'comment_item': comment, - 'depth': depth - }