On 31 Jan 2008 Thu 06:22:43 Ivan Illarionov wrote:
> There is 'post_save' signal with 'created' parameter. But,
> unfortunately, this feature is undocumented...

It's something related with "dispatcher" class? Please let me know if there is 
more about signals than the code below. I simply just use this;

-----
...
...
from django.db.models import signals
from django.dispatch import dispatcher
from myapp.signal_handlers import do_something_before_adding

class FooModel(models.Model)
        .....
        .....

dispatcher.connect(do_something_before_adding, signal=signals.pre_save, 
sender=FooModel)

-----

This code will call "do_something_before_adding" before the object is created. 
I don't know what parameters are appended to function, but just do triald and 
error :) I hope, this will help you Julien.

Btw, in the "django.db.models.signals", these signals exist;

class_prepared
pre_init
pot_init
pre_save
post_save
pre_delete
post_delete
post_syncdb

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to