title: Formatting JSON in Serializer - Django REST
body: <p>I am new to Django and Django-REST and I was tasked to create a serializer.
  The output of my serializer looks like this:</p>
  
  <pre><code>    {
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
      {
          "id": 1,
          "name": "a",
          "description": "a",
          "price": "1.00",
          "images": [
              {
                  "image_addr": "http://127.0.0.1:8000/media/products/Screenshot_from_2018-05-16_15-07-34.png",
                  "product": 1
              },
              {
                  "image_addr": "http://127.0.0.1:8000/media/products/Screenshot_from_2018-05-16_16-42-55.png",
                  "product": 1
              }
          ]
      }
  ]
  }
  </code></pre>
  
  <p>How can i tweak my serializer in a way that my output would look like this:</p>
  
  <pre><code>   {
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
      {
          "id": 1,
          "name": "a",
          "description": "a",
          "price": "1.00",
          "images": [
             "http://127.0.0.1:8000/media/products/Screenshot_from_2018-05-16_15-07-34.png",   
             "http://127.0.0.1:8000/media/products/Screenshot_from_2018-05-16_16-42-55.png"
          ]
      }
  ]
  }
  </code></pre>
  
  <p>The serializers that I am using are:</p>
  
  <pre><code>    class ProductImageSerializer(serializers.ModelSerializer):
          class Meta:
              model = ProductImage
              fields = ('image_addr', 'product')
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    class ProductSerializer(serializers.ModelSerializer):
          images = ProductImageSerializer(many=True, read_only=True)
          class Meta:
              model = Product
              fields = ('id', 'name', 'description', 'price','images')
  </code></pre>
  
  <p>My models used are:</p>
  
  <pre><code>    class ProductImage(models.Model):
          image_addr = models.FileField(upload_to='products/',null=True)
          product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name='images')
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    class Product(models.Model):
          name = models.CharField(max_length=150)
          price = models.DecimalField(max_digits=9, decimal_places=2)
          product_count = models.IntegerField(blank=True, default=0, validators=[MinValueValidator(0)])
          description = models.TextField()
          category = models.ManyToManyField(Category)
          objects = ProductManager()
  </code></pre>
  
  <p>My view used is:</p>
  
  <pre><code>    class CategoryProductList(generics.ListAPIView):
          serializer_class = ProductSerializer
  
          def get_queryset(self):
              queryset = Product.objects.filter(category__id=self.kwargs['pk'])
              return queryset
  </code></pre>