                  '`lookup_field` attribute on this field.'
              )
              raise Exception(msg % self.view_name)
  
      def get_url(self, obj, view_name, request, format):
          """
          Given an object, return the URL that hyperlinks to the object.
  
          May raise a `NoReverseMatch` if the `view_name` and `lookup_field`
          attributes are not configured to correctly match the URL conf.
          """
          # Unsaved objects will not yet have a valid URL.
          if obj.pk is None:
              return None
  
          lookup_value = getattr(obj, self.lookup_field)
          kwargs = {self.lookup_url_kwarg: lookup_value}
          return reverse(view_name, kwargs=kwargs, request=request, format=format)
  
  
  class SlugRelatedField(RelatedField):
      def __init__(self, **kwargs):
          self.slug_field = kwargs.pop('slug_field', None)
 
</s> remove         if isinstance(self.queryset, QuerySet):
 </s> add         if isinstance(queryset, QuerySet): </s> remove         msg = self.error_messages['invalid'] % humanized_format
        raise ValidationError(msg)
 </s> add         self.fail('invalid', format=humanized_format) </s> remove         msg = self.error_messages['invalid'] % humanized_format
        raise ValidationError(msg)
 </s> add         self.fail('invalid', format=humanized_format) </s> remove         msg = self.error_messages['invalid'] % humanized_format
        raise ValidationError(msg)
 </s> add         self.fail('invalid', format=humanized_format)
                  '`lookup_field` attribute on this field.'
              )
              raise Exception(msg % self.view_name)
  















  
  class SlugRelatedField(RelatedField):
      def __init__(self, **kwargs):
          self.slug_field = kwargs.pop('slug_field', None)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
 Clean up relational fields queryset usage 
rest_framework/relations.py