def to_rest_models(models, includes=None):
    """ Convert the models into a dict for serialization

    models should be an array of single model objects that
    will each be serialized.

    :return: dict
    """

    props = {}
    props['data'] = []

    for model in models:
        props['data'].append(_to_rest(model, includes=includes))

    props['included'] = _to_rest_includes(models, includes=includes)

    return props
Convert the models into a dict for serialization

    models should be an array of single model objects that
    will each be serialized.

    :return: dict