import django.dispatch
pizza_done = django.dispatch.Signal(providing_args=["toppings", "size"])
class PizzaStore:
...
def send_pizza(self, toppings, size):
pizza_done.send(sender=self.__class__, toppings=toppings, size=size)
from .signals import pizza_done
from .classes import PizzaStore
def handler(sender, *args, **kwargs):
pass
pizza_done.connect(hander, sender=PizzaStore)