  
      def get_filter_kwargs(self, attrs):
          raise NotImplementedError('`get_filter_kwargs` must be implemented.')
  
      def __call__(self, attrs):
          filter_kwargs = self.get_filter_kwargs(attrs)
  
          queryset = self.queryset.filter(**filter_kwargs)
          if self.instance is not None:
              queryset = queryset.exclude(pk=self.instance.pk)
          if queryset.exists():
 
</s> remove             queryset = queryset.exclude(pk=self.instance.pk)
 </s> add             return queryset.exclude(pk=self.instance.pk)
        return queryset

    def __call__(self, attrs):
        self.enforce_required_fields(attrs)
        queryset = self.queryset
        queryset = self.filter_queryset(attrs, queryset)
        queryset = self.exclude_current_instance(attrs, queryset) </s> remove         queryset = self.queryset.filter(**filter_kwargs)
 </s> add     def exclude_current_instance(self, attrs, queryset):
        """
        If an instance is being updated, then do not include
        that instance itself as a uniqueness conflict.
        """ </s> remove     def get_filter_kwargs(self, attrs):
        raise NotImplementedError('`get_filter_kwargs` must be implemented.')
 </s> add     def enforce_required_fields(self, attrs):
        """
        The `UniqueFor<Range>Validator` classes always force an implied
        'required' state on the fields they are applied to.
        """
        missing = dict([
            (field_name, self.missing_message)
            for field_name in [self.field, self.date_field]
            if field_name not in attrs
        ])
        if missing:
            raise ValidationError(missing) </s> remove     def get_filter_kwargs(self, attrs):
 </s> add     def filter_queryset(self, attrs, queryset): </s> remove     def get_filter_kwargs(self, attrs):
 </s> add     def filter_queryset(self, attrs, queryset):
    def filter_queryset(self, attrs, queryset):
        raise NotImplementedError('`filter_queryset` must be implemented.')
  
      def get_filter_kwargs(self, attrs):
          raise NotImplementedError('`get_filter_kwargs` must be implemented.')
  
    def filter_queryset(self, attrs, queryset):
        raise NotImplementedError('`filter_queryset` must be implemented.')
    def filter_queryset(self, attrs, queryset):
        raise NotImplementedError('`filter_queryset` must be implemented.')
  
          queryset = self.queryset.filter(**filter_kwargs)
          if self.instance is not None:
              queryset = queryset.exclude(pk=self.instance.pk)
          if queryset.exists():
keep keep keep keep replace replace keep keep keep keep keep
 Uniqueness constraints imply a forced 'required=True'. Refs #1945 
rest_framework/validators.py