(self)
return categorys
递归获得分类目录的父级
        :return:
递归获得分类目录的父级
        :return:
递归获得分类目录的父级 : return :
def get_category_tree(self):
        """
        递归获得分类目录的父级
        :return:
        """
        categorys = []

        def parse(category):
            categorys.append(category)
            if category.parent_category:
                parse(category.parent_category)

        parse(self)
        return categorys
def get_category_tree ( self ) : categorys = [ ] def parse ( category ) : categorys . append ( category ) if category . parent_category : parse ( category . parent_category ) parse ( self ) return categorys