You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this class method define
categorys.append(child) is error?
def get_sub_categorys(self):
"""
获得当前分类目录所有子集
:return:
"""
categorys = []
all_categorys = Category.objects.all()
def parse(category):
if category not in categorys:
categorys.append(category)
childs = all_categorys.filter(parent_category=category)
for child in childs:
if category not in categorys:
categorys.append(child)
parse(child)
parse(self)
return categorys
The text was updated successfully, but these errors were encountered:
jzplyy
changed the title
Category模型定义
Category define error
Dec 19, 2023
this class method define
categorys.append(child) is error?
The text was updated successfully, but these errors were encountered: