Почему мои данные не обновляются сами по себе ?- django
class Weight(models.Model):
weight = models.DecimalField(max_digits=100,decimal_places=1)
def __str__(self):
return str(self.weight)
items = [
str(Weight.objects.all()[0]),
str(Weight.objects.all()[1]),
str(Weight.objects.all()[2]),
str(Weight.objects.all()[3]),
str(Weight.objects.all()[4]),
]
и у меня есть такая формула
self.index = round((float(frac) * (float(self.digital.coff.__str__())*float(items[0])) * ((float(self.complexity.__str__())*float(items[1])) + (float(self.implem.imp.__str__())*float(items[2])))*((float(1*float(items[3])))+(float(self.conn.conn.__str__())*float(items[4])))))
но когда я обновляю данные любого весового объекта, результат из формулы self.index остается тем же, как я могу решить эту проблему