import django.dispatch
badge_awarded = django.dispatch.Signal(providing_args=['user', 'badge'])
@receiver(badge_awarded)
def do_something_after_badge_awarded(sender, user, badge, **kwargs):
print "Badge Signal received"
print sender # <play.meta_badges.neueBadge object at 0x109733d90>
print user # user object
print badge # badge object
print kwargs
Badge Signal received
<play.meta_badges.neueBadge object at 0x109733d90>
player1
Test Badge 2
{'signal': <django.dispatch.dispatcher.Signal object at 0x1096da4d0>}
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5e8f655c-8385-46aa-94ae-2c5baef2034a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
+1. You need to measure rather than assume.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD4ANxWOT1Mg%3D47H89s0Xoi9m7kVA-y1Ag5qoh9vrdO9Nuc7tg%40mail.gmail.com.