[Answered ]-Update a model field when another modal field is updated

1👍

You can override save method of A model. You can also achieve it using django signals, but it’s more convenient and clear to override the save method.

def save(self, *args, **kwargs):
    super().save(args, kwargs)
    B.objects.filter(<relation_field>).update(quantity=self.quantity)

Leave a comment