title: Fields not appearing for POST API browsable view - django Rest Framework
body: <p>I am trying to write API for add product to shopping cart, using django Rest framework. I wrote a simple serializer.py and view.py. </p>
  
  <p>model.py:</p>
  
  <pre><code>class Product(models.Model):
      title = models.CharField(max_length=100,unique=True)
      description = models.TextField()
      image_url = models.URLField(max_length=200)
      price = models.DecimalField(max_digits=8,decimal_places=2)
      date_available = models.DateField
  class LineItem(models.Model):
      product = models.ForeignKey(Product)
      unit_price = models.DecimalField(max_digits=8,decimal_places=2)
      quantity = models.IntegerField()
  </code></pre>
  
  <p>serializers.py</p>
  
  <pre><code>class LineItemSerializer(serializers.ModelSerializer):
      class Meta:
          model = LineItem
          fields = ('product', 'unit_price', 'quantity')
  
      def product(self, instance):
          return instance.product.title
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class RESTforCart(APIView):
      def post(self, request, *args, **kwargs):
          #print request.POST['product']
          product = Product.objects.get(id=request.POST['product'])
          cart = request.session['cart']
          cart.add_product(product)
          request.session['cart'] = cart
          lists=request.session['cart'].items 
          serializer = LineItemSerializer(lists,many=True)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data, status=status.HTTP_201_CREATED)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
  def get(self, request, *args, **kwargs):
      lists=request.session['cart'].items 
      serializer = LineItemSerializer(lists,many=True)
      return Response(serializer.data)
  </code></pre>
  
  <p>urls.py </p>
  
  <pre><code>(r'^shoppinglists2/$', RESTforCart.as_view()),
  </code></pre>
  
  <p>[My browsable view looks like this:Just Content field.No Unit Price and Quantity field]</p>
  
  <p><a href="https://i.stack.imgur.com/G2TuI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/G2TuI.png" alt="enter image description here"></a></p>