code: def _check_values(self, value):
          
          key = self.to_field_name or 'pk'
          # deduplicate given values to avoid creating many querysets or
          # requiring the database backend deduplicate efficiently.
          try:
              value = frozenset(value)
          except TypeError:
              # list of lists isn't hashable, for example
              raise ValidationError(
                  self.error_messages['list'],
                  code='list',
              )
          for pk in value:
              try:
                  self.queryset.filter(**{key: pk})
              except (ValueError, TypeError):
                  raise ValidationError(
                      self.error_messages['invalid_pk_value'],
                      code='invalid_pk_value',
                      params={'pk': pk},
                  )
          qs = EventOccurrence.objects.filter(**{'%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['invalid_choice'],
                      code='invalid_choice',
                      params={'value': val},
                  )
          return qs
docs: 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.)