Using linked objects after saving an object?

I have a situation where I want to unload an xml fragment (atom event) every time a model instance is saved, updated or deleted. The snippet should include information about related objects.

I cannot find an event that allows me to use information from related objects after my object is saved. The signal post_save

appears to be fired before the associated object is saved.

I am currently overriding the ModelAdmin save_model method to display a complete record of the atom containing information about the instance and associated objects. But this will only work as long as the instances are managed through the admin interface, not when the instances are updated programmatically.

Anyone who has managed to create something that looks like a signal post_save_of_everything

?

+2


source to share


2 answers


I would suggest that you could add your own save method to your model that calls the base class's save method and then creates your Atom feed.



0


source


Does the atom record only need to be updated once per save instance? If not, could you just listen to post_save on related objects?



0


source







All Articles