def category_parents(category):
    """
    Get list parents of category
    :param category: Object category,  product. e.g <8c8fff64-8886-4688-9a90-24f0d2d918f9>
    :return: Dict | List | List categories and sub-categories. e.g.
        [
            {
                "id": "c0136516-ff72-441a-9835-1ecb37357c41",
                "name": "Sombreros y Gorros"
            },
            {
                "id": "ff2cbe7e-a817-41d5-9363-6175bb757505",
                "name": "Accesorios"
            },
            {
                "id": "7b68e61c-516a-45b4-8eda-654f3af39e03",
                "name": "ROPA MUJER"
            }
        ]
    """

    if not category.parent_category:
        return []

    parent_list = []
    while category.parent_category:
        parent_list.append({
            'id': str(category.id),
            'name': category.name,
        }
        )

        category = category.parent_category

    parent_list.append({
        'id': str(category.id),
        'name': category.name,
    }
    )

    return parent_list