djang1.6.5 signal的特别处理

旧版本   新版本
def my_handler(sender) def my_handler(sender, **kwargs)
my_signal = object() my_signal = django.dispatch.Signal()
dispatcher.connect(my_handler, my_signal) my_signal.connect(my_handler)
dispatcher.send(my_signal, sender) my_signal.send(sender)
dispatcher.connect(my_handler, my_signal, sender=Any) my_signal.connect(my_handler, sender=None)
posted @ 2014-07-20 15:08  tommy.yu  阅读(191)  评论(0编辑  收藏  举报