title: How do I relate two table to know which value is included in ManyToMany field in Django?
body: <p>Hope that the title is not as confusing as I thought it would be. I currently have a table for <strong>PaymentsData</strong>:</p>
  <pre><code>class PaymentsData(models.Model):
     match = models.CharField(max_length=30)
     amount = models.DecimalField(default = 0, max_digits = 5, decimal_places = 2)
     players = models.ManyToManyField(Profile, blank=True)
     playerspaid = models.ManyToManyField(Profile, related_name='paid', blank=True)
     datespent = models.DateField('Date Spent')
  
  def __str__(self):
      return self.match
  </code></pre>
  <p>This field is used to create matches and include the number of players that played within players section and when they paid move them to <strong>playerspaid</strong> field.
  What I wanted to do is using a different table, I wanted to present all the players individually, and include the <strong>matches</strong> that they need to pay for (which we can know by fetching the <strong>players</strong> in <strong>PaymentsData</strong> above). So it should look something similar to this:</p>
  <pre><code>class PlayersPaymentDetails(models.Model):
      player = models.OneToOneField(Profile, on_delete=models.CASCADE)
      matches = models.ManyToManyField(PaymentsData, blank=True)
      amountdue = models.DecimalField(default = 0, max_digits=5, decimal_places = 2)
  </code></pre>
  <p>here in the matches, it should show all the matches that the player is selected in the players field within <strong>PaymentsData</strong> and the <strong>amountdue</strong> should show how much the player owes all together.</p>
  <p>I have tried customising the model using the <strong>save()</strong> method, however when the <strong>players</strong> gets unselected from the <strong>PaymentsData</strong>, it does not change the <strong>PlayersPaymentDetails</strong> table.</p>
  <p>Hope someone can help, Thanks. Do let me know if that's not clear.</p>