Alex Rivera | Logout

Is there a way to list Django signals?

Asked 2009-07-06T15:48:08.390
27

Is there a way to see which signals have been set in Django?

Edit
Report

1 Answer

34

It's not really exposed in docs but Signal is just a class that contains a list of receivers which are called on event. You can manually check this list:

from django.db.models.signals import *

for signal in [pre_save, pre_init, pre_delete, post_save, post_delete, post_init, post_syncdb]:
    # print a List of connected listeners
    print(signal.receivers)
        
answered 2009-12-25T09:12:02.990

Your Answer