Signals

0 views
Skip to first unread message

oakmad

unread,
Sep 7, 2009, 9:47:06 PM9/7/09
to app-engine-django
I'm migrating pieces of my current project to gae using the helper.
I've got a signal setup currently in my model using
signals.post_save.connect(task_get_news, sender=News) but for some
reason its not firing on the post_save event. Do I need to do anything
special in consideration of the helper? If I call the signal handler
directly from my code it works so there seems to be something not
firing, are signals fully supported?

Thanks

Adam

Matt Brown

unread,
Sep 8, 2009, 1:47:54 PM9/8/09
to app-engi...@googlegroups.com
Hi Adam,

There shouldn't be any issues using the core signals functionality
provided by Django.

I expect the problem here, is that the helper uses the model and
datastore code provided by the App Engine SDK rather than Django's
built in module class and database logic. Hence when you call put/save
on one of your models, you're executing App Engine specific code, not
Django code, which doesn't fire the signal you are expecting.

Your best option is probably to override the put() method of the
helper's Model and make an explicit call to the Django signal
framework to fire off the signal you are expecting, after the put call
in the super class completes.

Of course if you want to submit a patch to the helpers Model to do
this by default to retain compatibility with Django's model we would
most definitely consider it :)

Cheers

--
Matt Brown
ma...@mattb.net.nz
Mob +353 86 608 7117 www.mattb.net.nz

Reply all
Reply to author
Forward
0 new messages