def METHOD_NAME(self, request):
    toc_headers = []
    parent = None
    for section in self.content:
        header = section.value.get("header")
        id = section.value.get("section_id")
        if section.block_type == "Fig_Section":
            if parent:
                toc_headers.append(parent)
            parent = {
                "header": header,
                "id": id,
                "anchor": f"#{id}",
                "children": [],
            }
            if any(
                y.block_type == "data_points_block"
                for y in section.value["content"]
            ):
                # If a data_points_block is part of this section's contents,
                # add the data points to the headers collection
                for p in self.data_points.order_by("number"):
                    parent["children"].append(
                        {
                            "header": p.title,
                            "id": f"{id}.{p.number}",
                            "anchor": f"#{p.anchor}",
                        }
                    )
        elif section.block_type == "Fig_Subsection":
            # if the first block is a subsection instead of a section
            if not parent:
                parent = {"header": "", "id": "", "children": []}
            parent["children"].append(
                {"header": header, "id": id, "anchor": f"#{id}"}
            )
    toc_headers.append(parent)
    return toc_headers