'Returns a dictionary mapping each of the given IDs to the object with
that ID.'

def in_bulk(self, id_list):

    assert self.query.can_filter(), "Cannot    use    'limit'    or    'offset'    with    in_bulk"
    assert isinstance(id_list, (tuple, list, set, frozenset)), 'in_bulk()    must    be    provided    with    a    list    of    IDs.'
    if (not id_list):
        return {}
    qs = self._clone()
    qs.query.add_filter(('pk__in', id_list))
    qs.query.clear_ordering(force_empty=True)
    return dict([(obj._get_pk_val(), obj) for obj in qs.iterator()])
