Created
April 21, 2016 11:36
-
-
Save imsickofmaps/bd89b12fe063da5414b20f166dd6784b to your computer and use it in GitHub Desktop.
List details on who is getting post_save signals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
from django.db.models.signals import post_save | |
msg = '{name} in line {line} of {path}' | |
for receiver in post_save.receivers: | |
_, receiver = receiver | |
receiver = receiver() | |
print(msg.format(name=receiver.__name__, line=inspect.getsourcelines(receiver)[1], path=inspect.getsourcefile(receiver))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment