I've been stucked on this problem for a few days. How can I perform a specific action when an object's status has been updated?
I'v got an Order
django model with a status
field. When an order's status goes from new
to processed
, I need to perform some specific actions.
The thing is, the status can be updated from anywhere: a frontend view, an admin module, a bulk action, a management command, etc.
Also, I only want the action to be performed after the order is saved.
It seems the post_save
signal could work, but I cannot find a way to detect if the status has changed, and what the old value is.
I checked the django fsm, but it's clearly not the way to go.
Any idea?