3

I'm using post_init and post_save signals to watch a single table column, then update other tables when the watched column is changed in the CMS. This works great, but the response in the CMS is still "1 blah was changed successfully."

Instead, I need to display the real number of items that were updated inside the signal. I'm at a loss -- can't find this anywhere and I'm not even sure where to look. Suggestions on the proper technique, or pointer to a doc that I've missed?

beardsly
  • 31
  • 1
  • 3

1 Answers1

0

Sorry for answering this question many years after it was done, but I searched a lot for a solution (without success) to do that and in the end I found a way that I would like to share. Not a better way, but it works:

To share data between the signal receiver function and the view:

    # your signal receiver function
    @receiver(request_started)
    def request_started_receiver(sender, **kwargs):
        kwargs['environ']['CUSTOM_DATA_TO_VIEW'] = 'My Custom Data'

and

    # your view
    def index(request):
        custom_data = request.META.get('CUSTOM_DATA_TO_VIEW')
Júlio Filho
  • 51
  • 1
  • 3