From e6b8c724fbfe55d8458e1b52def95aba38dd5438 Mon Sep 17 00:00:00 2001 From: p9xvr8cjz <2775939221@qq.com> Date: Fri, 7 Nov 2025 18:55:14 +0800 Subject: [PATCH] Delete 'comments/templatetags/comments_tags.py' --- comments/templatetags/comments_tags.py | 30 -------------------------- 1 file changed, 30 deletions(-) delete mode 100644 comments/templatetags/comments_tags.py 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 - }