It is important that pre/post init signals will not get more expensive
than they currently are. Even now they can give around 100% overhead
to model.__init__(). And this is in a case where the currently
initialized model has no signals attached at all - it is enough that
_some_ model in the project has pre or post init signals attached. I
don't believe signaling cost is severe for .save and .delete as those
operations are doing much heavier work than __init__ anyways, but for
init the cost is big enough already. If at all possible, make them
cheaper.

In addition, just changing the signals to fire for every parent class
is pretty much as backwards incompatible as it gets: imagine you have
post_save signal which increments a counter in a related model on
create (posts in a thread for example). You have also a proxy model,
and you have attached the same signal to the proxy model, too, because
that is what you have to do to get the signal fire when you save the
proxy model. After the change you will get the counter incremented two
times for create, and you have a data corrupting bug. This might not
be a common pattern, but for example Django's use of pre and post init
signals follows the pattern of attaching to each subclass individually
and these signals would thus fire multiple times.

 - Anssi

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

Reply via email to