Django Signals - trigger when model changed

2019-10-05 Thread Omar Helal
Hi all, I came across this ticket in stack overflow to try to find a solution for the issue of calling a signal only when a particular field on a model was updated. https://stackoverflow.com/questions/39034798/django-signals-for-models-value-change-condition I didn't want to use any third

Django signals created kwargs is True while updating

2018-07-24 Thread Aamu Padi
I think I am missing something here, but here it goes. I have a model, and it is a sender for a post_save signal. class Book(models.Model): ... created_at = models.DateTimeField(default=timezone.now) bought = models.BooleanField(default=False) @receiver(post_save, sender=Book) def

Re: Query Regarding Django Signals

2018-05-05 Thread Ruhia gr
n Friday, May 4, 2018 at 9:40:12 PM UTC+5:30, Nipun Arora wrote: >> >> 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

Re: Query Regarding Django Signals

2018-05-05 Thread Nipun Arora
okay thanks people..! On Friday, May 4, 2018 at 9:40:12 PM UTC+5:30, Nipun Arora wrote: > > 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 wri

Re: Query Regarding Django Signals

2018-05-04 Thread jacob duyon
or third party models. > > 4.5.2018 19.10 "Nipun Arora" <aroranipu...@gmail.com> kirjoitti: > > 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 c

Re: Query Regarding Django Signals

2018-05-04 Thread Jani Tiainen
Hi, Signals are also good for decoupling things. For example you want to do some post save action for third party models. 4.5.2018 19.10 "Nipun Arora" <aroranipu...@gmail.com> kirjoitti: Hello Community I was puzzled by the fact that if django signals are not asynchronous wh

RE: Query Regarding Django Signals

2018-05-04 Thread Matthew Pava
] 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

Query Regarding Django Signals

2018-05-04 Thread Nipun Arora
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

Re: Channels with django signals

2018-02-03 Thread John Wayne
Oh I saw that you fixed it recently. Thank you anyway :) On Sunday, February 4, 2018 at 1:22:58 AM UTC+1, Andrew Godwin wrote: > > Hi John, > > This is fixed in the asgiref master branch, I should be releasing it soon. > > Andrew > > On Sat, Feb 3, 2018 at 4:14 PM, John Wayne

Re: Channels with django signals

2018-02-03 Thread Andrew Godwin
Hi John, This is fixed in the asgiref master branch, I should be releasing it soon. Andrew On Sat, Feb 3, 2018 at 4:14 PM, John Wayne wrote: > Hi everyone, > > I am trying to send a channels message from a django signal. The problem > ist that the signal function is

Channels with django signals

2018-02-03 Thread John Wayne
Hi everyone, I am trying to send a channels message from a django signal. The problem ist that the signal function is not async. So I tried to use the AsyncToSync wrapper. But it seems this is not possible as the signal handler is run by a thread and has no event loop. ...

Re: Django signals **kwargs

2017-06-27 Thread yingi keme
Okkk.. Thanks Vijay.. Yingi Kem > On 27 Jun 2017, at 9:53 PM, Vijay Khemlani wrote: > > Same link > > https://docs.djangoproject.com/en/1.11/ref/signals/#post-save > > post_save¶ > > django.db.models.signals.post_save¶ > Like pre_save, but sent at the end of the

Re: Django signals **kwargs

2017-06-27 Thread Vijay Khemlani
Same link https://docs.djangoproject.com/en/1.11/ref/signals/#post-save post_save¶ django.db.models.signals.post_save¶ Like pre_save

Re: Django signals **kwargs

2017-06-27 Thread yingi keme
Okk. But what i am actually asking is, what type of contents does the **kwargs. Give me a typical example of **kwargs in the context of signals. The actual data **kwargs may contain. Yingi Kem > On 27 Jun 2017, at 9:24 PM, Vijay Khemlani wrote: > >

Re: Django signals **kwargs

2017-06-27 Thread Vijay Khemlani
https://docs.djangoproject.com/en/1.11/topics/signals/#receiver-functions We’ll look at senders a bit later, but right now look at the **kwargs argument. All signals send keyword arguments, and may change those keyword arguments at any time. In the case of request_finished, it’s documented as

Django signals **kwargs

2017-06-27 Thread yingi keme
So i want to know, when using a model signals. The reciever function has **kwargs. What is the content of **kwargs in this reciever function below: @reciever(post_save, sender=MyModel) def func(sender, instance, **kwargs): # some action. -- You received this message because you are

Re: Working with Django signals

2016-01-06 Thread Bernardo Garcia
Hi luisza I've choose work overriding the save() method of the AbstractUser class, instead of apply the post_save() signal to the create_profile_for_new_use function. According to the prevouos mentioned, my User MedicalProfile, PatientProfile y PhisiotherapystProfile models stayed so:

Re: Working with Django signals

2015-12-31 Thread Luis Zárate
I suggest you to change the user creation form to set the three attributes that you need (Is medical, is physuitherapist, is patient), so in the first form (when you create the user) you will have usernarme, password, Is_medical, is_physuitherapist, is_patient. Take a look -

Working with Django signals

2015-12-30 Thread Bernardo Garcia
I have a custom users schema in Django for work with roles or users type, creating an application named userprofile which will be or will setup my custom user model. In my settings.py I have the following configuration: INSTALLED_APPS = [ ... 'userprofile',]#Custom model Users

Are django signals triggered within migrations?

2015-08-31 Thread Michael
Hi, I'm doing some data migrations (creating new model instances) in the migrations files and I have a couple of receivers on the `post_save` signal for the models I am creating instances. >From what I have seen, it seems that the signals are not triggered within the migration. Is that true?

Re: Django signals to all connections?

2013-08-20 Thread Jani Tiainen
Hi, Well it seems that you have understood things a bit incorrectly. First at all, only logged in user is the one accessing some page (a view) from Django system. After that there is nobody logged in traditional sense - there is no simple way to detect that user closed browser and was "logged

Re: Django signals to all connections?

2013-08-19 Thread Gerd Koetje
but can it also update a message on a page where that user is without reloading the page? lets say user 1 is on page http://www.domain.com/acertainview/ and at that moment i start a signal as admin with the text hello there Can i update the text on his page to that text (live) Op maandag 19

Re: Django signals to all connections?

2013-08-19 Thread Rafael Garbin
Yes, always one user logged in, django will look for receiver and running the method. 2013/8/19 Gerd Koetje > omg god bless python/django.. > > > So this really works? > > user 1 is logged in to my app > user 2 is logged in to my app > > As admin i send a signal

Re: Django signals to all connections?

2013-08-19 Thread Gerd Koetje
omg god bless python/django.. So this really works? user 1 is logged in to my app user 2 is logged in to my app As admin i send a signal with the text hello all and it will be printed on the page that user 1 and 2 are on? -- You received this message because you are subscribed to the Google

Re: Django signals to all connections?

2013-08-19 Thread Rafael Garbin
from django.contrib.auth import user_logged_in @receiver(user_logged_in) def my_func(...) -- 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

Re: Django signals to all connections?

2013-08-19 Thread Avraham Serour
maybe you can use a middleware to log access On Mon, Aug 19, 2013 at 7:29 AM, Gerd Koetje wrote: > Is is possible to start an event at all connected users with signals? > If this is possible can someone show me an example of it. > > > Greetz > Gerd > > -- > You

Django signals to all connections?

2013-08-18 Thread Gerd Koetje
Is is possible to start an event at all connected users with signals? If this is possible can someone show me an example of it. Greetz Gerd -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Working with django signals

2010-12-31 Thread mo.mughrabi
/django-signals-implementing-on-save-listner Regards, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-user

Re: django signals

2008-11-02 Thread Steve Holden
belred wrote: > i'm having touble finding documention about django signals that > explain how they behave under apache child processes. if i have a > signal go off and have a listener for that signal. will only the > listener in same child process receive it or will that same liste

django signals

2008-11-01 Thread belred
i'm having touble finding documention about django signals that explain how they behave under apache child processes. if i have a signal go off and have a listener for that signal. will only the listener in same child process receive it or will that same listener in all apache child processes

Re: Django Signals?

2007-01-17 Thread Rob Hudson
Cool. I was mainly concerned that it might not be officially documented for a reason. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django Signals?

2007-01-17 Thread James Bennett
On 1/17/07, Rob Hudson <[EMAIL PROTECTED]> wrote: I did find a reference in the wiki... http://code.djangoproject.com/wiki/Signals That was my rough attempt at documentation; I really need to go back and clean that up to see if I can't get it into some sort of shape which would suit the

Re: Django Signals?

2007-01-17 Thread Jacob Kaplan-Moss
On 1/17/07 6:47 PM, Rob Hudson wrote: > And this one is especially nice... > http://www.mercurytide.com/knowledge/white-papers/django-signals Right now this is about the best source of documentation there is, unfortunately. > Why isn't it documented? Because nobody's documented i

Django Signals?

2007-01-17 Thread Rob Hudson
What's up with Django signals? They seem to be an undocumented feature, though one I think is handy. $ grep -i signals django/docs/* returns nothing. Googling for "signals site:djangobook.com" comes up empty. I did find a reference in the wiki... http://code.djangoproject.com/wi