title: How to return id from django rest framework to angular application
body: <p>I am trying to make a http post from an angular application:</p>
  
  <pre><code>var body = {client: 1, quantityItem: 2, price: this.formData.GTotal, profitability: 'profitable'}
      return this.http.post(environment.apiURL+'/order/', body, {headers: this.httpHeaders});
  </code></pre>
  
  <p>I'm sending the fields from the application and the djangorestframework backend generates the id for the order, how can i get this id? so I can make another http post with the order items and the order id.</p>
  
  <p>models(order):</p>
  
  <pre><code>class Order(models.Model):
      user = models.ForeignKey(User, on_delete=models.CASCADE, default=None, blank=True, null=True)
      client = models.ForeignKey(Client, on_delete=models.CASCADE, default=None)
      quantityItem = models.BigIntegerField(default=1)
      grand_total = models.FloatField(default=0)
      profitability = models.CharField(max_length=50)
      create_date = models.DateTimeField(default=timezone.now, blank=True, null=True)
      update_date = models.DateTimeField(auto_now=True, blank=True, null=True)
  </code></pre>
  
  <p>models(orderitem):</p>
  
  <pre><code>class OrderItem(models.Model):
      order = models.ForeignKey(Order, on_delete=models.CASCADE)
      product = models.ForeignKey(Product, on_delete=models.CASCADE)
      price = models.BigIntegerField(default=0)
      quantityProduct = models.BigIntegerField(default=1)
  </code></pre>
  
  <p>serializers.py:</p>
  
  <pre><code>class OrderSerializer(serializers.ModelSerializer):
      class Meta:
          model = Order
          fields = ('id', 'client', 'quantityItem', 'grand_total',
                    'profitability', 'create_date', 'update_date')
  </code></pre>
  
  <p>viewsets.py:</p>
  
  <pre><code>class OrderViewSet(viewsets.ModelViewSet):
      queryset = Order.objects.all()
      serializer_class = OrderSerializer
  </code></pre>
  
  <p>what I have to do get the id back and send another request with the order items?</p>