class LoanInformation(models.Model):
id = models.AutoField(primary_key=True)
customer = models.ForeignKey(Customer,on_delete=models.CASCADE)
amount_to_pay = models.IntegerField()
def __str__ (self):
return
self.idclass Payments(models.Model):
id = models.AutoField(primary_key = True)
loan = models.ForeignKey(LoanInformation,on_delete=models.CASCADE)
amount = models.IntegerField()
paidon = models.DateField(auto_now=True)
def __str__ (self):
return
self.idI want to display amount_to_pay - sum of amount