title: Django REST framework serialization error on pk field
body: <p>In my Django REST framework project i have this model:</p>
  
  <pre><code>class ml_request(models.Model):
      model_id = models.CharField(max_length=100)
      created = models.DateTimeField(auto_now=True)
      p_country = models.CharField(max_length=100, blank=False, default='')
      p_description = models.TextField(null=False, blank=False)
      p_designation = models.CharField(max_length=200, blank=False, default='')
      p_points = models.IntegerField(default=00)
      p_price = models.IntegerField(default=00, blank=False)
      p_province = models.CharField(max_length=100, blank=False, default='')
      p_region_1 = models.CharField(max_length=100, blank=False, default='')
      p_region_2 = models.CharField(max_length=100, blank=False, default='')
      p_variety = models.CharField(max_length=100, blank=False, default='')
      p_winery = models.CharField(max_length=100, blank=False, default='')
      owner = models.ForeignKey('auth.User', related_name='req_owner', 
  on_delete=models.CASCADE)
      highlighted = models.TextField()
  
  class Meta:
      ordering = ('created',)
  </code></pre>
  
  <p>then i create my serializer like this:</p>
  
  <pre><code>from rest_framework import serializers
  from botoapi.models import ml_request, ml_response, LANGUAGE_CHOICES, 
  STYLE_CHOICES, ml_logs
  from django.contrib.auth.models import User
  
  class RequestSerializer(serializers.HyperlinkedModelSerializer):
  
      id = serializers.IntegerField(label='ID', read_only=True)
      highlight = serializers.HyperlinkedIdentityField(view_name='request-highlight', format='html')
      owner = serializers.ReadOnlyField(source='owner.username')
  
      class Meta:
          model = ml_request
          fields = ('id', 'model_id', 'highlight', 'created', 'p_country', 
  'p_description', 'p_designation',
                'p_points', 'p_price', 'p_province', 'p_region_1', 'p_region_2', 
  'p_variety', 'p_winery', 'owner')
  
          def create(self, validated_data):
              log_save = ml_logs(l_verbose=validated_data, l_method="CREATE", 
               l_action=validated_data.get("model_id", None))
              log_save.save()
              return validated_data
  </code></pre>
  
  <p>and is my view code:</p>
  
  <pre><code>class RequestViewSet(viewsets.ModelViewSet):
      queryset = ml_request.objects.all()
      serializer_class = RequestSerializer
      permission_classes = (IsAuthenticatedOrReadOnly,
                        IsOwnerOrReadOnly,)
  
      @detail_route(renderer_classes=[renderers.StaticHTMLRenderer])
      def highlight(self, request, *args, **kwargs):
          snippet = self.get_object()
          return Response(snippet.highlighted)
  
      def perform_create(self, serializer):
          serializer.save(owner=self.request.user)
  </code></pre>
  
  <p>bur when i run it and try to add values django return this error:</p>
  
  <blockquote>
    <p>AttributeError at /requests/
    'dict' object has no attribute 'pk'
    Request Method: POST
    Request URL:    <a href="http://127.0.0.1:8000/requests/" rel="nofollow noreferrer">http://127.0.0.1:8000/requests/</a>
    Django Version: 1.11.7
    Exception Type: AttributeError
    Exception Value:<br>
    'dict' object has no attribute 'pk'</p>
  </blockquote>
  
  <p>i have the id as PK and i add it in my serializer, someone can help me to wonder why this happens?</p>
  
  <p>Thanks in advance</p>