title: Django Rest Framework: pass user from view to serializer
body: <p>I have such view for user change password:</p>
  
  <pre><code>class ChangePasswordView(generics.UpdateAPIView):
      serializer_class = ChangePasswordSerializer
      permission_classes = [IsAuthenticated]
  
          def put(self, request, *args, **kwargs):
              data = request.data.copy()
              data['user'] = self.request.user
              serializer = self.get_serializer(data=data)
              serializer.is_valid(raise_exception=True)
              user = serializer.validated_data['user']
              user.set_password(serializer.validated_data["new_password"])
              user.save()
              return Response(status=status.HTTP_204_NO_CONTENT)
  </code></pre>
  
  <p>And serializer for this view looks like this:</p>
  
  <pre><code>class ChangePasswordSerializer(serializers.Serializer):
      old_password = serializers.CharField()
      new_password = serializers.CharField()
      new_password_retyped = serializers.CharField()
  
      def validate(self, data):
          old_password = data.get('old_password')
          new_password = data.get('new_password')
          new_password_retyped = data.get('new_password_retyped')
          user = data.get('user')
  
          # misc validation checks
  
          data['user'] = user
          return data
  </code></pre>
  
  <p>and my problem is that user object is not being passed to serializer, tried printing it to see content of data inside <code>put</code>:</p>
  
  <pre><code>&lt;QueryDict: {'old_password': ['testpassword'], 'new_password': ['testpassword1'], 'new_password_retyped': ['testpassword1'], 'user': [&lt;User: root&gt;]}&gt;
  </code></pre>
  
  <p>and inside serializer:</p>
  
  <pre><code>OrderedDict([('old_password', 'testpassword'), ('new_password', 'testpassword1'), ('new_password_retyped', 'testpassword1')])
  </code></pre>
  
  <p>As you can see, user is missing. First, I thought that it may have something to do with passing object to serializer so I changed <code>data['user'] = self.request.user</code> to <code>data['user'] = self.request.user.username</code> so it would only pass string with username, but with no luck</p>