[Answered ]-How to track m2m field changes in django?

2👍

I am sure you have found the solution by now. However for others reference, you can do that by checking the kwargs['action'] == "pre_add" or kwargs['action'] == "pre_remove" to check the value before any update happens. You can find more details here.

0👍

Have a look at the Django docs:

https://docs.djangoproject.com/en/dev/ref/signals/#m2m-changed

You should be able to use the action and pk_set parameters of the signal handler to figure out what happened.

Leave a comment