django-signals Questions

3

Solved

I want to do a data denormalization for better performance, and put a sum of votes my blog post receives inside Post model: class Post(models.Model): """ Blog entry """ author = models.ForeignKe...

3

Solved

I'm doing some kind of refactoring for my project, where I'm relying on the django django.contrib.auth.models.Permission model. So far I define the permissions for each new user using a post_save s...
Shushan asked 7/9, 2015 at 22:29

2

Solved

I'm working with Django signals, but they seem to be received twice, even if emitted once. Here's the code I'm working with (it's a simple wrapper to use Uploadify with Django)... # Signal-emittin...
Stelmach asked 25/9, 2009 at 17:35

3

Solved

having read the docs, https://docs.djangoproject.com/en/dev/topics/signals/ i have created this in my signals.py file: from django.db.models.signals import post_save from django.dispatch import r...
Swallowtail asked 24/5, 2012 at 13:47

5

Solved

I have a django rest app using django rest auth. I'm trying to log something everytime a user log in using signals. I've searched on the web on how to use signals and I haven't found any interesti...
Tessera asked 8/4, 2017 at 20:59

5

Solved

I have a question about django. I have ManyToMany Models here class Product(models.Model): name = models.CharField(max_length=255) price = models.DecimalField(default=0.0, max_digits=9, decimal...
Sexology asked 22/10, 2012 at 15:14

4

Solved

I have a tough time understanding how signals work into my application (and how they work period). These are three areas where I assume they would apply (with my current knowledge): Send XML to a...
Soso asked 19/1, 2010 at 21:26

4

Solved

I have an AppConfig.ready() implementation which depends on the readiness of an other application. Is there a signal or method (which I could implement) which gets called after all application rea...
Cowes asked 17/8, 2018 at 9:37

3

I am trying to develop an auction type system, where a customer makes an order, and then different stores can offer a price for that order. An interesting part of this system is that when the ord...
Cowpox asked 6/10, 2017 at 22:3

8

Solved

Based on Django's documentation I was reading, it seems like signals.py in the app folder is a good place to start with, but the problem I'm facing is that when I create signals for pre_save and I ...
Bartonbartosch asked 18/8, 2011 at 22:53

7

Solved

I have a signal_handler connected through a decorator, something like this very simple one: @receiver(post_save, sender=User, dispatch_uid='myfile.signal_handler_post_save_user') def signal_hand...
Shantel asked 28/10, 2012 at 19:39

1

Solved

I really can't find anything solid in the docs. Lets say I'm doing something like this: from django.db.models.signals import post_save from django.dispatch import receiver class Item(models.Model...
Matronize asked 6/4, 2019 at 18:29

3

Solved

I need to do some background post-processing on newly created objects in Django. This post-processing should only run on new objects, not objects that are just updated. I know that in pre_save I c...
Mondrian asked 20/5, 2012 at 10:16

1

Solved

Is there a way to start a Viewflow process with Django model post_save signal. I managed to do this: //start viewflow process start = ( flow.StartSignal(post_save, create_dest_flow) .Next(this.a...
Kempis asked 30/12, 2018 at 19:39

4

Solved

I read about django signals (http://docs.djangoproject.com/en/dev/topics/signals/), but as far as I understand, signals are never converted into literal SQL triggers (http://en.wikipedia.org/wiki/D...
Callaghan asked 21/8, 2010 at 21:52

2

Personally I like using signals: from django.db import models from django.db.models.signals import pre_save class MyModel(models.Model): ... def custom_action_before_saving(sender, instance, *...
Arad asked 11/3, 2016 at 20:55

3

Solved

class Badge(SafeDeleteModel): owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, on_delete=models.PROTECT) restaurants = models.ManyToManyField(Restaurant) identifier =...
Haslam asked 3/9, 2018 at 9:49

5

Solved

I'm having trouble wrapping my head around this. Right now I have some models that looks kind of like this: def Review(models.Model) ...fields... overall_score = models.FloatField(blank=True) ...
Standish asked 4/10, 2008 at 13:37

3

I am using django 2.0.8 and Python 3.5. I want to be able to send and receive custom signals when an object is saved to the database. I have followed the Django documentation on listening to signa...
Kerguelen asked 31/8, 2018 at 10:32

1

Solved

Imagine I have a model called A, which has a field called name. How can I get previous value and new value in pre_save signal? @receiver(pre_save, sender=A) def signal_product_manage_latest_versi...
Demagogic asked 9/8, 2018 at 20:46

1

Solved

I am trying to make SignalProcessor as per haystack documentation, here is my code: from haystack.signals import RealtimeSignalProcessor from products.models import ProductCreateModel from django....
Mcandrew asked 25/7, 2018 at 15:13

1

Solved

I have a question regarding the usage of dispatch_uid for signals. Currently, I am preventing multiple usage of the signal by simply adding if not instance.order_reference. I wonder now if dispatc...
Illboding asked 15/6, 2018 at 18:21

1

Solved

I can't understand why my m2m_changed signal is not triggered. Here is the code: models.py class Badge(TimeStampable, Expirable, Deactivable, SafeDeleteModel): _safedelete_policy = HARD_DELETE...
Maui asked 31/5, 2018 at 13:25

0

I am using post_save signal to trigger the creation of profile data for User instance. The problem is if I create a User object from data migration then the post_save signal isn't triggering. Howe...
Gaitskell asked 13/5, 2018 at 18:13

2

Solved

For setting up new development systems I would like to have a "post initial migration" signal. It seems that something like this does not exist yet. In detail: I want a signal which runs after th...
Banks asked 3/5, 2018 at 9:23

© 2022 - 2024 — McMap. All rights reserved.