#15711: Abstract model managers should return subclass instances
-------------------------------------+-------------------------------------
               Reporter:  jdunck     |        Owner:  nobody
                   Type:  New        |       Status:  new
  feature                            |    Component:  Database layer
              Milestone:             |  (models, ORM)
                Version:  1.2        |     Severity:  Normal
             Resolution:             |     Keywords:  pony
           Triage Stage:  Design     |    Has patch:  0
  decision needed                    |  Needs tests:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------

Comment (by anonymous):

 Well, I just meant for ABCs, but I see that this is a slippery slope.  I
 think in general, concrete inheritance is to be avoided, but I understand
 it may be useful at times.

 I suppose part of the problem is that a concrete base may be inherited by
 multiple subclasses so that there's no right answer in what instance to
 return.  Diamond inheritance out of the ORM makes me queasy.

 I just feel that from a reusable app perspective (and encouraging reusable
 apps to ship ABCs in general) it would help the app writer quite a bit to
 be able to rely on instance(ABC) coming out of the ORM.  Is there some way
 we could draw a bright line around concrete to avoid narrow/widen?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15711#comment:5>
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 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to