from typing import Any


def forms_to_formset_post_data(forms_data: list[dict[str, Any]]) -> dict[str, Any]:
    """
    Convert a list of form dicts into Django formset-compatible POST data.
    """
    formset_data: dict[str, Any] = {
        "form-TOTAL_FORMS": str(len(forms_data)),
        "form-INITIAL_FORMS": "0",
    }
    for i, form_data in enumerate(forms_data):
        formset_data.update(
            {f"form-{i}-{key}": value for key, value in form_data.items()}
        )
    return formset_data
