#9318: "Virtual" behaviour for signal dispatcher and model inheritance
-------------------------------------+--------------------------------------
          Reporter:  svetlyak40wt    |         Owner:  nobody                   
           
            Status:  new             |     Milestone:                           
           
         Component:  Core framework  |       Version:  1.0                      
           
        Resolution:                  |      Keywords:  model inheritance, 
signals, dispatch
             Stage:  Accepted        |     Has_patch:  1                        
           
        Needs_docs:  0               |   Needs_tests:  0                        
           
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Changes (by mtredinnick):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 The principle seems sound enough, although we need to think hard about
 whether to turn this on by default, since it will change existing
 behaviour in backwards-incompatible ways for some signal handlers. It
 could be controlled in an "off by default" way by adding a flag to the
 connect method, indicating that we also wish to receive emits that
 originated on the child. We should consider adding a parameter like
 "from_child" to signal emits to indicate if the signal is coming from a
 sub-class so that handlers have an opportunity to avoid duplicate work.

 On an implementation note (and the patch needs more careful examination
 than I've given it just now, but this stood out), if we're going to "leak"
 information about `_meta` and parents into dispatcher.py, we might as well
 just test if it's an instance of `django.db.models.Model`, rather than
 seeing if it's a class with a `_meta` attribute. But there could be some
 other way to structure that entirely so that working out the right
 emitting classes to use can be more self-contained within a model itself
 and the dispatcher.py could avoid knowing about that. Needs some
 thought/creativity.

 I'll make this "accepted", since it's a feature worth adding, but what
 shape the final feature will take still needs a bit of consideration, I
 feel.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9318#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to