0
Enter primary data (raw data)where it has values . Flot and I am already calculating the total in function "totalv2" ta run
class Funcionario(models.Model): Custocoleta = models.Decimalfield( max_digits=8, decimalplaces=2, null=False, Blank=False )
CustoIda = models.DecimalField(
max_digits=8,
decimal_places=2,
null=False,
blank=False
)
CustoVenda = models.DecimalField(
max_digits=8,
decimal_places=2,
null=False,
blank=False
)
objetos = models.Manager()
def totalv2(self):
return sum([self.CustoColeta,self.CustoIda,self.NfDeEntrada])
my problem is due to the fact that I need a way to calculate the total (gross) ie take the value of all totalv2 (which is a sub-total) and add up to have the value all freight already made
class conta(models.Model):
def totalfrete(self):
for x in Funcionario:
x=sum([self.totalv2])
return x
a second class was created but I was unsuccessful