'Given a list of possible PK values, returns a QuerySet of the
corresponding objects. Raises a ValidationError if a given value is
invalid (not a valid PK, not in the queryset, etc.)'

def _check_values(self, value):

    key = (self.to_field_name or u'pk')
    try:
        value = frozenset(value)
    except TypeError:
        raise ValidationError(self.error_messages[u'list'], code=u'list')
    for pk in value:
        try:
            self.queryset.filter(**{key: pk})
        except ValueError:
            raise ValidationError(self.error_messages[u'invalid_pk_value'], code=u'invalid_pk_value', params={u'pk': pk})
    qs = self.queryset.filter(**{(u'%s__in' % key): value})
    pks = set([force_text(getattr(o, key)) for o in qs])
    for val in value:
        if (force_text(val) not in pks):
            raise ValidationError(self.error_messages[u'invalid_choice'], code=u'invalid_choice', params={u'value': val})
    return qs
