def METHOD_NAME(self, category):
    thread_path = []
    if category.level:
        categories = Category.objects.filter(
            tree_id=category.tree_id, lft__lte=category.lft, rght__gte=category.rght
        ).order_by("level")
        thread_path = list(categories)
    else:
        thread_path = [category]
    thread_path[0].name = self.get_root_name()
    return thread_path