  from django.core.urlresolvers import resolve, get_script_prefix, NoReverseMatch
  from rest_framework.compat import urlparse
  
  
  def get_default_queryset(serializer_class, field_name):
      manager = getattr(serializer_class.opts.model, field_name)
      if hasattr(manager, 'related'):
          # Forward relationships
          return manager.related.model._default_manager.all()
      # Reverse relationships
      return manager.field.rel.to._default_manager.all()
  
  
  class RelatedField(Field):
      def __init__(self, **kwargs):
          self.queryset = kwargs.pop('queryset', None)
          self.many = kwargs.pop('many', False)
          super(RelatedField, self).__init__(**kwargs)
 
</s> remove         if isinstance(self.queryset, QuerySet):
 </s> add         if isinstance(queryset, QuerySet): </s> remove     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)

 </s> add  </s> remove         'invalid': _("Date has wrong format. Use one of these formats instead: %s"),
 </s> add         'invalid': _('Date has wrong format. Use one of these formats instead: {format}'),
  from django.core.urlresolvers import resolve, get_script_prefix, NoReverseMatch
  from rest_framework.compat import urlparse
  
  









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