title: Find different category into all product in Django
body: <p>I have a list of all products which belong to different categories.</p>
  
  <p><strong>model.py</strong></p>
  
  <pre><code> class Product(models.Model):
          product_name = models.CharField(max_length=50,null=True, blank=True)
          details = models.CharField(max_length=100, null=True, blank=True)
          company_name = models.CharField(max_length=50,null=True, blank=True)
          category = models.ForeignKey(ProductClass,null=True, blank=True)
  </code></pre>
  
  <p>Category is a <code>ForeignKey</code> of <code>ProductClass</code>.</p>
  
  <p>Now I want a list of all different categories. I do not want a list of repetitive categories. For that I tried <code>obj = CustomerLeads.objects.all()</code></p>
  
  <pre><code>obj = Product.objects.all()
  
  
      c = []
          for i in obj:
              c.append(i.item_required)
  
          cat = set(c)
          return JsonResponse({'data':cat})
  </code></pre>
  
  <p>I am getting error <code>set([&lt;ProductClass: accessories&gt;, &lt;ProductClass: other&gt;]) is not JSON serializable</code></p>
  
  <p>How can I get a list of all different categories?</p>