On Apr 12, 10:27 pm, Anssi Kääriäinen <anssi.kaariai...@thl.fi> wrote: > > So perhaps we do need the signal inheritance behavior to be opt-in when > > connecting the signal handler. I think I'd like to see a deprecation > > path so that eventually the inheritance behavior is the default, and you > > have to opt out of it, as I think in most cases it's the desired behavior. > > Unfortunately this seems to be the only backwards compatible way > forward. I don't know how to do the technical details... from > __future__ import pre_save? :)
Could we force the caller to define the wanted signal inheritance mode when .connect() is called? The inherit mode must be one of True,False or None. Default of None means no inheritance (as now) but it will be deprecated. Another problem is that delete fires the same signal multiple times in the inheritance chain. We can't remove the parent signal for backwards compatibility reasons, nor can we fire them as then inheriting listeners will see the delete signals multiple times. Maybe the parent class signal could be sent in a way that it is only visible to those listeners having None as their inherit argument - that is those who use the deprecation mode setting. When the None as argument is removed, so is the parent delete signal, too. The above would lead into clean situation where signals are handled coherently. I know the above is ugly, but it is just for the transition period. Another option is to continue as currently: model signals aren't handled coherently, and there is no signal inheritance. Django users have managed to survive thus far with the current signals implementation, so maybe it doesn't need fixing? Any opinions on the above transition phase idea? Other ideas? Is the "define signal inheritance on connect" the wanted behavior in 1.7 or should it be something else? - 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.