              except AttributeError:
                  pass
  
          # Standard case, return the object instance.
          return super(RelatedField, self).get_attribute(instance)
  
      def get_choices(self, cutoff=None):
          queryset = self.get_queryset()
          if queryset is None:
              # Ensure that field.choices returns something sensible
 
</s> remove         return super(RelatedField, self).run_validation(data)
 </s> add         return super().run_validation(data) </s> remove                 return super(CustomSearchFilter, self).get_search_fields(view, request)
 </s> add                 return super().get_search_fields(view, request) </s> remove class ListModelMixin(object):
 </s> add class ListModelMixin: </s> remove             if isinstance(value, six.text_type):
 </s> add             if isinstance(value, str): </s> remove         if isinstance(ret, six.text_type):
 </s> add         if isinstance(ret, str):
        return super().get_attribute(instance)
              except AttributeError:
                  pass
  
          # Standard case, return the object instance.
        return super().get_attribute(instance)
  
      def get_choices(self, cutoff=None):
          queryset = self.get_queryset()
          if queryset is None:
              # Ensure that field.choices returns something sensible
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/relations.py