Last active
September 30, 2019 06:35
-
-
Save ilya-muhortov/b5996085e368939dc1ad3eb059dcbec6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from django.dispatch import receiver | |
from django.db.models.signals import post_save | |
from .models import ModelName | |
__all__ = [ | |
'model_name_post_create' | |
] | |
@receiver(post_save, sender=ModelName) | |
def model_name_post_create(sender, instance, raw, created, **kwargs): | |
pass |
This file contains hidden or 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 django.dispatch | |
__all__ = ['new_signal'] | |
new_signal = django.dispatch.Signal(providing_args=['param', 'another_param']) | |
def handle_new_signal(param1, another_param): | |
pass | |
new_signal.connect(handle_new_signal) | |
new_signal.send(None, param='param1', another_param='another_param') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment