I have a REST API built using Django and TastyPie. My goal is to add a task to the work queue when new data is sent to a specific model.
I was about to connect to post_save and then run, but the model contains ManyToMany relationships, and so post_save starts before the m2m relationships are updated and the connection to the m2m_changed signal seems messy. I receive several signaling events, and my code will have to check the instance after each of them and try to determine if it is ready to fire the event. Some of the ManyToMany fields may be null, so when I get the m2m_changed signal, I really donβt know for sure if this would save.
Is there a proper way to do this? Does TastyPie allow you to hook into a POST event and do something at the end? All I found points me to post_save events to do this.
Does Django have a way to tell me when all m2m updates for an instance of this model are complete?
source share