title: Django model nested serializer
body: <p>I have the model structure like below</p>
  
  <pre><code>class BaseProduct:
     id = models.CharField(max_length=15)
     name = models.CharField(max_length=20)
  
  class Product
     base_product = ForeigKey(BaseProduct)
     name = models.CharField(max_length=20)
  
  class Condition:
     category = models.ForeignKey(Product, related_name='allowed_product')
     check = models.IntegerField(default=0)
     allow = models.PositiveSmallIntegerField(default=1)
  </code></pre>
  
  <p>The query:</p>
  
  <pre><code>Product.objects.filter(condition__allow=1, condition__check=1)
  </code></pre>
  
  <p>I want format something like below
  <strong>Base Product and inside that list of products</strong> based on allow and check filter </p>
  
  <pre><code>[
      {
          "name": "BaseProduct 1",
          "products": [
              {
  
                  "name": "TV",
  
              }, {}, ....
  
          ]
      },
  ........
  ]
  </code></pre>