title: handling many to many relation in django models
body: <p>I am working on a project named &quot;Super Market Inventory Management System&quot;. There are some models requiring many-to-many relation among them.</p>
  <p>I tried to add ManyToManyField(to=model, on_delete=models.CASCADE). However, it works but I need to add some extra fields to the bridge table between the two tables.
  How can I do It?</p>
  <p>Given below is my models.py</p>
  <pre><code>class Purchase(models.Model):
      pay_status = models.CharField(max_length=50, choices=PAYSTATUS_CHOICES, default=&quot;Pending&quot;)
      date_of_purchase = models.DateTimeField(auto_now_add=True)
      last_payment = models.DateTimeField(auto_now=True)
  
  class Product(models.Model):
      name = models.CharField(max_length=200)
      barcode = models.IntegerField(blank=True, null=True)
      description = models.TextField(blank=True, null=True)
      # image =
      weight = models.TextField(blank=True, null=True)
      status = models.BooleanField(default=True)
      price = models.FloatField()
      created = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
  
  class PurchaseProduct(models.Model):
      purchase_id = models.ForeignKey(to=Purchase, on_delete=models.CASCADE)
      product_id = models.ForeignKey(to=Product, on_delete=models.CASCADE)
      unit_price = models.FloatField()
      quantity = models.IntegerField()
      price = models.FloatField()
  </code></pre>
  <p>In the bridge table I also want to add the unit price and the quantity how can I do?
  OR
  Is there any alternate way of doing???</p>
  <p>However if I do not add unit price and quantity I don't need to create this bridge table all the endings will be done by Django itself but I must require the above mentioned fields in my model</p>