Opened 3 years ago

Closed 3 years ago

#18454 closed New feature (fixed)

Add ability to pass several signals to `receiver`

Reported by: dmedvinsky Owned by: dmedvinsky
Component: Core (Other) Version: 1.4
Severity: Normal Keywords: signal, receiver
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: no UI/UX: no

Description

Pull Request: https://github.com/django/django/pull/136

This adds ability to use receiver in the following way:

@receiver([post_save, post_delete], sender=MyModel)
def signals_receiver(sender, **kwargs):
    ...

Quite often I want to connect both post_save and post_delete signals
for some particular sender.

Change History (1)

comment:1 Changed 3 years ago by Florian Apolloner <florian@…>

  • Resolution set to fixed
  • Status changed from new to closed

In [d4da08375b634544b95859d4d4667b8f05e3a29a]:

Fixed #18454 -- Added ability to pass a list of signals to receiver.

Added ability to use receiver decorator in the following way:

@receiver([post_save, post_delete], sender=MyModel)
def signals_receiver(sender, kwargs):

...

Note: See TracTickets for help on using tickets.
Back to Top