pytoolbox.django.signals.dispatch module

class pytoolbox.django.signals.dispatch.InstanceSignal(providing_args=None, use_caching=False)[source]

Bases: django.dispatch.dispatcher.Signal

send(sender=None, **named)[source]

Send signal from sender to all connected receivers.

If any receiver raises an error, the error propagates back through send, terminating the dispatch loop. So it’s possible that all receivers won’t be called if an error is raised.

Arguments:

sender
The sender of the signal. Either a specific object or None.
named
Named arguments which will be passed to receivers.

Return a list of tuple pairs [(receiver, response), … ].

send_robust(sender=None, **named)[source]

Send signal from sender to all connected receivers catching errors.

Arguments:

sender
The sender of the signal. Can be any Python object (normally one registered with a connect if you actually want something to occur).
named
Named arguments which will be passed to receivers.

Return a list of tuple pairs [(receiver, response), … ].

If any receiver raises an error (specifically any subclass of Exception), return the error instance as the result for that receiver.