def models_from_ids(sas, cls, ids):
    """Generator that, given a sequence of IDs, yields model instances.

    Performance is poor. TODO SOMEONE IMPROVE THIS PLEASE
    """
    for id in ids:
        yield sas.query(cls).get(id)
