django-signals Questions
2
In my application post_delete signals being recorded in a specific model and when it was removed.
class A(models.Model):
...
class B(models.Model):
a = models.ForeignKey('A')
class C(models.Mo...
Compress asked 19/12, 2014 at 12:53
4
Solved
All, I've got a issue with django signals.
I have a model
In an effort to speed up responsiveness of page loads, I'm offloading some intensive processing that must be done, via a call to a second ...
Cacilie asked 15/12, 2011 at 23:59
1
Solved
TL;DR:
I need a way to trigger a custom signal after the post_save signal, automatically, is there any way of doing it?
I'm currently developing a library for django that requires a lot of come...
Nolly asked 30/11, 2017 at 15:4
2
Solved
I need to do some actions when one field has changed.
Since this action needs to work with already saved object, I can't use pre_save signal like this:
@receiver(pre_save, sender=reservation_mod...
Joappa asked 1/8, 2017 at 11:47
1
Solved
I have a rather long running task that needs to be executed after inserting or updating an specific model.
I decided to use post_save signal instead of overriding save method to reduce coupling. S...
Conceptualize asked 24/7, 2017 at 9:23
1
In Django I do have two models "Author" and "Publication" that are connected with a Many-to-Many-Field, so that I can assign different authors to a publication. Additionally, I have to use a custom...
Coercion asked 29/4, 2015 at 18:58
4
Is there a way to see which signals have been set in Django?
Irrelievable asked 6/7, 2009 at 15:48
1
Solved
I have a model file that uses a post_save signal to create a linked row in another table. In typical fashion, I can create a page from one of my views which is decorated with @transaction.atomic.
...
Shannan asked 31/3, 2016 at 11:11
1
Solved
I have the following code in accounts/signals/__init__.py:
from django.db.models.signals import post_save
from django.dispatch import receiver
from orders.models import Order
from accounts.models ...
Deluca asked 16/12, 2016 at 17:18
3
Solved
I've already read all related questions.
I have two Django projects, and signals work fine in one, but do not work in second one (I've just copy-pasted code and changed names respectively).
I hav...
Epistaxis asked 22/11, 2016 at 15:47
3
Solved
I see I can override or define pre_save, save, post_save to do what I want when a model instance gets saved.
Which one is preferred in which situation and why?
Drakensberg asked 15/7, 2013 at 2:9
2
Solved
Have gone through
Django 1.9 deprecation warnings app_label
but answers couldn't fix my problem, so asking again.
I have an app that is added to INSTALLED_APPS in settings.
when ever I run man...
Divorce asked 2/7, 2015 at 8:34
3
Solved
I need to detect a post_remove signal, so I have written :
def handler1(sender, instance, action, reverse, model, pk_set, **kwargs):
if (action == 'post_remove'):
test1() # not declared but make ...
Vouch asked 27/7, 2012 at 10:40
3
I'm trying to do something like these proposed signal decorators. In addition to having a decorator that connects the decorated method to a signal (with the signal's sender as an argument to the de...
Favien asked 22/2, 2010 at 11:58
4
Solved
I've got 2 signals being sent at user registration, socialauth_registered and post_save. I'd like for socialauth_registered to precede post_save, as it affects the function that post_save triggers....
Kempf asked 4/4, 2012 at 19:0
1
Solved
Django 1.9.
Trying to learn signals. In the documentation for AppConfig.ready() it is said that "Subclasses can override this method to perform initialization tasks such as registering signals." (...
Loyola asked 25/5, 2016 at 15:26
1
Solved
I'm learning to code and have a live Django project to keep me motivated. In my Django app, users leave comments, while others reply to the said comments.
Everytime a user refreshes their home pa...
Boyett asked 8/5, 2016 at 7:15
3
I am trying to leverage the post_save function of Django Signals in combination with Celery tasks. After a new Message object is saved to the database, I want to evaluate if the instance has one of...
Strenuous asked 7/7, 2015 at 16:13
3
Is there a way to cancel a deletion of record using django pre_delete signal?
example:
def on_delete(sender,**kwargs):
if not <some condition>:
#cancel the deletion
# else continue with ...
Debidebilitate asked 11/4, 2011 at 16:27
2
Solved
I am trying to set up some post_save receivers similar to the following:
@receiver(post_save, sender=Game, dispatch_uid='game_updated')
def game_updated(sender, **kwargs):
'''DO SOME STUFF HERE''...
Radical asked 11/9, 2011 at 2:6
4
Solved
Is it possible to save the related objects before the actual object being edited on a django admin form?
For example:
in models.py
class Parent(model.Model):
pass
class Child(model.Model):
pa...
Babul asked 13/2, 2013 at 16:45
3
Solved
I have an app not ready style error when i use signal. I think this is due to the User auth in the profile model , from what i've see using google there is some issue with the user auth.
i think t...
Shaniceshanie asked 16/10, 2015 at 7:50
1
Solved
Following is my code in the signals.py file placed in the package where the auth model is defined.
@receiver(post_migrate, sender=settings.AUTH_USER_MODEL)
def define_groups(sender, **kwargs):
# ...
Delighted asked 11/8, 2015 at 21:39
1
Solved
Can someone help me understand the update_field argument for Django signals?
According to the docs:
update_fields: The set of fields to update explicitly specified in the
save() method. None i...
Chandless asked 18/7, 2015 at 23:24
5
Solved
When an update/create is performed on a Django model (.save()) I would like to be able to "step in" and compare some particular attributes to what they were set to previously (if they previously ex...
Catachresis asked 9/7, 2010 at 20:26
© 2022 - 2024 — McMap. All rights reserved.