Convert a list of objects in a list of dicts.

        Arguments
        ---------
        value : iterable
            The list (or other iterable) to get values to get some resources from.
        resource : dataql.resources.List
            The ``List`` object used to obtain this value from the original one.

        Returns
        -------
        list
            A list with one entry for each iteration get from ``value``.
            If the ``resource`` has only one sub-resource, each entry in the result list will
            be the result for the subresource for each iteration.
            If the ``resource`` has more that one sub-resource, each entry in the result list will
            be another list with an entry for each subresource for the current iteration.

        Raises
        ------
        dataql.solvers.exceptions.NotIterable
            When the value is not iterable.

def coerce(self, value, resource):
        """Convert a list of objects in a list of dicts.

        Arguments
        ---------
        value : iterable
            The list (or other iterable) to get values to get some resources from.
        resource : dataql.resources.List
            The ``List`` object used to obtain this value from the original one.

        Returns
        -------
        list
            A list with one entry for each iteration get from ``value``.
            If the ``resource`` has only one sub-resource, each entry in the result list will
            be the result for the subresource for each iteration.
            If the ``resource`` has more that one sub-resource, each entry in the result list will
            be another list with an entry for each subresource for the current iteration.

        Raises
        ------
        dataql.solvers.exceptions.NotIterable
            When the value is not iterable.

        """

        if not isinstance(value, Iterable):
            raise NotIterable(resource, self.registry[value])

        # Case #1: we only have one sub-resource, so we return a list with this item for
        # each iteration
        if len(resource.resources) == 1:
            res = resource.resources[0]
            return [self.registry.solve_resource(v, res) for v in value]

        # Case #2: we have many sub-resources, we return a list with, for each iteration, a
        # list with all entries
        return [
            [self.registry.solve_resource(v, res) for res in resource.resources]
            for v in value
        ]