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)
Source:stackexchange.com