The advantage with the signals is that you can put all that code in one place.  
You may have different views that are saving the same model, and it isn’t DRY 
to have to put that same code in multiple locations.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Nipun Arora
Sent: Friday, May 4, 2018 10:37 AM
To: Django users
Subject: Query Regarding Django Signals

Hello Community

I was puzzled by the fact that if django signals are not asynchronous why do we 
use them as in when ever i want some trigger on post_save can't  i simply write 
that particular trigger in the same function that handles the request for 
saving a new object in django views..?
as in :

def handlerequest(Request):
    save instance to db
   Do the work i would do in the method handling the signal post_save


--
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+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b64f4e4-afa2-485b-96a9-825b3c93b95e%40googlegroups.com<https://groups.google.com/d/msgid/django-users/5b64f4e4-afa2-485b-96a9-825b3c93b95e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/10a41cd61e124053ae127bc226ce72fc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to