In my application, I want to create entries in certain tables when a new user signs up. For instance, I want to create a userprofile which will then reference their company and some other records for them. I implemented this with a post_save signal:
def callback_create_profile(sender, **kwargs):
# check if we are creating a new User...
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/Database_trigger).
If I'm correct that signals and triggers are different, then which one is better and in what ways? What's the best practice...
Hello,
I have some server startup code that is lying in the "models.py" of one of my Django apps. I need to run that code on server startup time.
The problem is, that code issues a SQL query, which prevents me from running syncdb with psycopg2 (it breaks the transaction, and tables are not created.)
Putting the code in a middleware an...
I have two models, a definition:
class Indicator(TimestampedModel):
some_definition_data = models.IntegerField()
and an instance:
class IndicatorInstance(TimestampedModel):
indicator = models.ForeignKey(Indicator)
some_instance_data = models.TextField()
I want to attach event code (signals) to Indicator definitions. I s...
I'm using dcramer's fork of django-paypal and I've been successful in setting it up until now. I tried to connect 'paypal.pro.signals.payment_was_successful' to a listener I wrote but it sends the signal multiple times which is causing errors in my application. I've tried adding the 'dispatch_uid' to my connect statement but it still sen...
I am making use of Django's contrib.comments and want to know the following.
Are there any utils or app out there that can be plugged into an app that sends you a notification when a comment is posted on an item?
I haven't really worked with signals that much, so please be a little bit descriptive.
This is what I came up with.
from d...
I am looking at accessing the user who owns the content_type of a posted comment
Currently I can access the user who posts, the comment, however I would like to notify the person who owns the item...
I tried doing user = comment.content_type.user but I get an error.
In my main __init__.py file
As soon as I change that to user = reque...
I have a task that runs in a celerybeat instance. When that talk is executed, it sometimes modifies a model object, which should fire off a post/pre_save signal, but it doesn't. The signal is not happening. I imagine this is due to django's signals being synchronous while celery is doing it's thing on a different server in a different th...