Hello, please can someone help me with the code to subtract 'b' from 'a' as shown below
a = Soapprod.objects.aggregate(Sum('Serial_White_Guava'))
b = Soapsales.objects.aggregate(Sum('Serial_White_Guava'))
class Soapprod (models.Model):
id = models.AutoField(primary_key=True)
Serial_White_Guava = models.PositiveIntegerField()
Serial_White_Premium = models.PositiveIntegerField()
Soft_Flower_Body_Wash = models.PositiveIntegerField()
Soft_Flower_Fresh = models.PositiveIntegerField()
Soft_Flower_Orange_Lightening = models.PositiveIntegerField()
Soft_Flower_Carot_Lightening = models.PositiveIntegerField()
Soft_Flower_Papaya_Extract = models.PositiveIntegerField()
Soft_Flower_Extra_Lightening = models.PositiveIntegerField()
Serial_White_Papaya_4in1 = models.PositiveIntegerField()
date = models.DateField(default = date.today)
def __str__(self):
return self.serial_white_guava
class Soapsales (Soapprod):
SOAP_MARKETER_STATUS = (
('M', 'Marketers'),
('D', 'Distributor'),
('A', 'Distributor_B'),
('B', 'Distributor_C'),
)
soap_marketer_status = models.CharField(max_length=1, choices=SOAP_MARKETER_STATUS)
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1c978c25-cbb4-41bd-ab01-b49aa6365826%40googlegroups.com.
No comments:
Post a Comment