In Django, can signals be used as callback functions? In other words, can the "sender" of a signal use it to gather data from another app, via the return value of send()
?
Yes.
Both
send()
andsend_robust()
return a list of tuple pairs[(receiver, response), ... ]
, representing the list of called receiver functions and their response values.
Do note that this is rather a rather unorthodox mechanism for this though; if you need the return value from a function, just call it directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With