  
  
  class BlogPostCommentListCreate(generics.ListCreateAPIView):
      model = BlogPostComment
      model_serializer_class = BlogPostCommentSerializer
  
  
  class BlogPostDetail(generics.RetrieveAPIView):
      model = BlogPost
  
 
</s> remove     def restore_object(self, attrs, instance=None):
        return BlogPostComment(**attrs)
 </s> add     class Meta:
        model = BlogPostComment
        fields = ('text', 'blog_post_url') </s> remove     sources = serializers.ManyPrimaryKeyRelatedField(queryset=ManyToManySource.objects.all())
 </s> add     sources = serializers.ManyPrimaryKeyRelatedField() </s> remove class BlogPostCommentSerializer(serializers.Serializer):
 </s> add class BlogPostCommentSerializer(serializers.ModelSerializer): </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')
    serializer_class = BlogPostCommentSerializer
  
  
  class BlogPostCommentListCreate(generics.ListCreateAPIView):
      model = BlogPostComment
    serializer_class = BlogPostCommentSerializer
  
  
  class BlogPostDetail(generics.RetrieveAPIView):
      model = BlogPost
  
keep keep keep keep replace keep keep keep keep keep
 `queryset` argument is now optional on writable model fields. 
rest_framework/tests/hyperlinkedserializers.py