title: Update an order after POST method Django Rest Framework
body: <p>I just started learning Django Rest Framework together with React and i am stuck on this problem for a couple of weeks now. Hope you guys can help me out.. Here's what i am trying to achieve: When a user clicks on 'Buy Now' there will be an order created with the <strong>status</strong> of the order set to <strong>open</strong>. This all works fine. My <strong>Orders</strong> view &amp; model looks like this:</p>
  <pre><code>class OrdersView(ListCreateAPIView):
  serializer_class = OrdersSerializer
  queryset = Orders.objects.all()
  
  def post(self, request):
      serializer = OrdersSerializer(data=request.data)
      if serializer.is_valid():
          data = serializer.validated_data
          price = data['price']
          pakket = data['pakket']
          payment = mollie_client.payments.create({
              'amount': {
                  'currency': 'EUR',
                  'value': price,
              },
              'description': pakket,
              'redirectUrl': 'http://127.0.0.1:3000/Thanks',
              'webhookUrl': 'http://6efd85bb183c.ngrok.io/api/order-status/',
              'method': 'ideal',
          })
          serializer.save(user=request.user, userID=request.user.id,
                          status=payment.status, orderID=payment.id)
          return Response(status=status.HTTP_201_CREATED, data=payment)
      return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
  class Orders(models.Model):
      userID = models.CharField(max_length=30)
      pakket = models.CharField(max_length=30)
      price = models.CharField(max_length=30)
      created_at = models.DateTimeField(default=one_hour_later)
      status = models.CharField(max_length=30)
      orderID = models.CharField(max_length=30)
      user = models.EmailField(max_length=120)
  
      def __str__(self):
          return self.user
  </code></pre>
  <p>My serializer called <strong>OrdersSerializer</strong> looks like this:</p>
  <pre><code>class OrdersSerializer(serializers.ModelSerializer):
      class Meta:
          model = Orders
          fields = '__all__'
          read_only_fields = ('user','status','orderID','userID')
  </code></pre>
  <p>After the status of the order has changed (the user made the purchase or not) my webhook is called (a POST) and i am retreiving the order by the <strong>id</strong> which is POSTED to the webhook. This is all taken care of by using an API client (mollie_client). This all works fine too. My View looks like this:</p>
  <pre><code>class OrderStatusView(ListCreateAPIView):
      serializer_class = OrdersSerializer
      queryset = Orders.objects.all()
      permission_classes = [AllowAny,]
      def post(self, request):
          data = request.data
          payment_id = data['id']
          payment = mollie_client.payments.get(payment_id)
          if payment.is_paid():
              return Response(status=status.HTTP_200_OK, data=payment.status)
          elif payment.is_pending():
              return Response(status=status.HTTP_200_OK, data=payment.status)
          elif payment.is_open():
              return Response(status=status.HTTP_200_OK, data=payment.status)
          else:
              return Response(status=status.HTTP_200_OK, data=payment.status)
          return Response(status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  <p>Now my problem is: How do i retreive the original Order (by the id) and <strong>update</strong> the status of the order.
  Grabbing the payment.status works fine, but how do i grab the Order and update its status from the payment.status?</p>
  <p>I am able to grab the original order by: <strong>Orders.objects.get(orderID=payment_id)</strong> inside the view, but from there i am stuck. I am not sure how i can update that specific order and change the status to payment.status.
  I am thinking i have to do something with the <strong>serializer.save(status=payment.status)</strong>.
  Maybe it is super simple, but i can't get my head around it.</p>
  <p>Hope its clear and you guys can help.
  Please keep in mind i am still a beginner on this topic.</p>
  <p>Thanks in advance!</p>
  <p>Greetings</p>