  class BlogPostCommentSerializer(serializers.Serializer):
      text = serializers.CharField()
      blog_post_url = serializers.HyperlinkedRelatedField(source='blog_post', view_name='blogpost-detail', queryset=BlogPost.objects.all())
  
      def restore_object(self, attrs, instance=None):
          return BlogPostComment(**attrs)
  
  
  class BasicList(generics.ListCreateAPIView):
      model = BasicModel
      model_serializer_class = serializers.HyperlinkedModelSerializer
 
</s> remove     blog_post_url = serializers.HyperlinkedRelatedField(source='blog_post', view_name='blogpost-detail', queryset=BlogPost.objects.all())
 </s> add     blog_post_url = serializers.HyperlinkedRelatedField(source='blog_post', view_name='blogpost-detail') </s> remove class BlogPostCommentSerializer(serializers.Serializer):
 </s> add class BlogPostCommentSerializer(serializers.ModelSerializer): </s> remove     model_serializer_class = BlogPostCommentSerializer
 </s> add     serializer_class = BlogPostCommentSerializer </s> remove     sources = serializers.ManyPrimaryKeyRelatedField(queryset=ManyToManySource.objects.all())
 </s> add     sources = serializers.ManyPrimaryKeyRelatedField() </s> remove                 field.initialize(parent=self)
 </s> add                 field.initialize(parent=self, field_name=model_field.name)
    class Meta:
        model = BlogPostComment
        fields = ('text', 'blog_post_url')
  class BlogPostCommentSerializer(serializers.Serializer):
      text = serializers.CharField()
      blog_post_url = serializers.HyperlinkedRelatedField(source='blog_post', view_name='blogpost-detail', queryset=BlogPost.objects.all())
  
    class Meta:
        model = BlogPostComment
        fields = ('text', 'blog_post_url')
    class Meta:
        model = BlogPostComment
        fields = ('text', 'blog_post_url')
  
  
  class BasicList(generics.ListCreateAPIView):
      model = BasicModel
      model_serializer_class = serializers.HyperlinkedModelSerializer
keep keep keep keep replace replace keep keep keep keep keep
 `queryset` argument is now optional on writable model fields. 
rest_framework/tests/hyperlinkedserializers.py