Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Djangoでは、シグナルをコールバック関数として使用できますか? 言い換えれば、シグナルの「送信者」は、シグナルの戻り値を介して、それを使用して別のアプリからデータを収集できますsend()か?
send()
はい。
と はどちらも、呼び出されたレシーバー関数とその応答値のリストを表すタプル ペアのリストを返しsend()ます。send_robust()[(receiver, response), ... ]
send_robust()
[(receiver, response), ... ]
ただし、これはかなり非正統的なメカニズムであることに注意してください。関数からの戻り値が必要な場合は、直接呼び出すだけです。