I\'m using django\'s post_save signal to execute some statements after saving the model.
class Mode(models.Model):
name = models.CharField(max_length=5)
You can use update_fields in django signals.
@receiver(post_save, sender=Mode)
def post_save(sender, instance, created, **kwargs):
# only update instance
if not created:
update_fields = kwargs.get('update_fields') or set()
# value of `mode` has changed:
if 'mode' in update_fields:
# then do this
pass
else:
# do that
pass