django-signals Questions
10
Solved
I have a few model inheritance levels in Django:
class WorkAttachment(models.Model):
""" Abstract class that holds all fields that are required in each attachment """
work = models.ForeignKey(Wo...
Snowberry asked 17/10, 2011 at 10:14
3
Solved
I have done the following signal in my project:
@receiver(pre_save, sender=group1)
@disable_for_loaddata
def total_closing_group1(sender,instance,*args,**kwargs):
total_group_closing_deb_po = ins...
Shipper asked 5/6, 2019 at 10:33
9
Solved
I'm using django's post_save signal to execute some statements after saving the model.
class Mode(models.Model):
name = models.CharField(max_length=5)
mode = models.BooleanField()
from django....
Pictor asked 19/4, 2016 at 13:14
13
Solved
I am getting TransactionManagementError when trying to save a Django User model instance and in its post_save signal, I'm saving some models that have the user as the foreign key.
The context and e...
Imponderable asked 30/1, 2014 at 13:52
7
Solved
I am trying to create activity streams of users from their status.
models:
class Status(models.Model):
body = models.TextField(max_length=200)
image = models.ImageField(blank=True, null=True, u...
Spicebush asked 25/1, 2015 at 9:35
4
Solved
I've been looking everywhere and I coulnd't find any reference about this, my Django model signal only works when the debug=True, but it doesn't work if debug=False, this occur both on localhost an...
Thermistor asked 31/8, 2021 at 17:43
9
Solved
I have a setup like this (simplified for this question):
class Employee(models.Model):
name = models.CharField(name, unique=True)
class Project(models.Model):
name = models.CharField(name, uniqu...
Glandulous asked 28/1, 2011 at 7:20
6
Solved
I need make a save with a model but i need disconnect some receivers of the signals before save it.
I mean,
I have a model:
class MyModel(models.Model):
...
def pre_save_model(sender, instance...
Dumbstruck asked 5/2, 2010 at 17:45
6
I have some problems when using signal in Django.
post_save occurs recursion because of instance.save() inside of function.
But strange thing is only one case occurs recursion.
Case not occurin...
Bust asked 14/9, 2016 at 2:28
5
Solved
I have a signal inside my django app where I would like to check if a certain field in my model has been updated, so I can then proceed and do something.
My model looks like this...
class Produc...
Hein asked 7/2, 2019 at 16:57
7
Solved
I'm having issues with ManytoMany Relationships that are not updating
in a model when I save it (via the admin) and try to use the new value within a
function attached to the post_save signal or wi...
Callihan asked 17/12, 2009 at 23:44
11
Solved
There are many Stack Overflow posts about recursion using the post_save signal, to which the comments and answers are overwhelmingly: "why not override save()" or a save that is only fired upon cre...
Potvaliant asked 31/5, 2012 at 19:27
1
Solved
I borrowed ideas from this answer to extend the default Site object created during the initial migration with Django sites framework. The new model, SiteSettings, establishes a OneToOne relationshi...
Diplegia asked 28/9, 2022 at 23:13
4
Solved
I have a model that saves an Excursion. The user can change this excursion, but I need to know what the excursion was before he change it, because I keep track of how many "bookings" are made per e...
Austral asked 3/9, 2014 at 14:52
4
Solved
I have a Django model and I want to modify the object permissions on or just after save. I have tried a few solutions and the post_save signal seemed the best candidate for what I want to do:
cla...
Regain asked 22/5, 2014 at 0:8
11
Solved
I have a django model, and I need to compare old and new values of field BEFORE saving.
I've tried the save() inheritance, and pre_save signal. It was triggered correctly, but I can't find the list...
Oat asked 29/4, 2014 at 9:43
2
Solved
Django is sending the pre/post_delete signals if you are using the queryset.delete() method, but shouldn't it then also send pre/post_save on queryset.update()?
Godoy asked 7/11, 2009 at 14:12
3
Solved
I have a model - Product, which contains a thumbnail image. I have another model which contains images associated with the product - ProductImage.
I want to delete both the thumbnail and the images...
Francenefrances asked 12/10, 2015 at 11:46
9
Solved
So I have various signals and handlers which are sent across apps. However, when I perform tests / go into 'testing mode', I want these handlers to be disabled.
Is there a Django-specific way of d...
Cordalia asked 30/8, 2013 at 12:6
2
I use Django 1.7 migrations, and in particular, want to populate a newly-created database with initial data. Thus, I use a data migration for this. It looks like this:
def populate_with_initial_da...
Cashier asked 24/10, 2014 at 6:31
4
Solved
I have written some APIs, for which the respective functions executive inside a transaction block. I am calling the save() method (after some modifications) on instance/s of a/several Model/s, and ...
Photothermic asked 16/10, 2015 at 22:56
0
I've implemented django signals for a model. It's only working fine while debug is True. Any idea how to fix this issue, so that post_save signal works when debug is False in production.
Here is my...
Eskimoaleut asked 18/10, 2021 at 17:25
5
I am new to Django and I'm not able to understand how to work with Django signals. Can anyone please explain "Django signals" with simple examples?
Thanks in advance.
Acetous asked 6/1, 2015 at 17:8
3
Solved
When a user changes their password, I want to send a signal so that I can do some stuff on some models.
How can I create this signal?
I've looked at the post_save signal for User:
post_save.conn...
Emblements asked 1/1, 2017 at 4:44
4
Solved
I am using Django-allauth for my login/signup related stuff, so when a user signs up(first time) into my site, I am redirecting him to /thanks/ page by defining below setting in settings.py file
...
Reduction asked 22/11, 2013 at 6:0
1 Next >
© 2022 - 2024 — McMap. All rights reserved.