class sales_line(models.Model):
sales_id = models.CharField(max_length=200)
item = models.CharField(max_length=200)
qty = models.IntegerField()
def __unicode__(self):
return self.sales_id
class Loss(models.Models):
sale_id = models.ForeignKey(sales_line)
how can i know how much quantity is lost if the sales_id is in loss table , then the sale is lost