#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
     Reporter:  BeryCZ               |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  5.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 > I'm expecting few hundereds, possibly even close to a thousand of use
 cases where we'll have to define the parent_link in concrete models
 instead of having it in ONLY one abstract model.

 As described in comment:3 you can already work around this case by
 ensuring that your abstract base inherits from the base you are referring
 to in your parent link. To me your position in comment:5 is more
 ideological than practical as lazy relationships are designed to help with
 circular references and references to swappable models not to obscure
 coupling issues between abstract and concrete entities of your projects.

 > But I think that having support of lazy relationships in all cases
 except one will still be a bug, even if you document the exception.

 You have to put things in perspective here. This pattern never worked
 (#20883 apparently failed at implementing proper support for it) and no
 one considered enough of a limitation to report it since MTI and abstract
 models were added to Django almost two decades ago. All signs points at
 this being a niche use case that happens to have a reasonable alternative

 If you spent the time trying to implement 1. yourself and gathered
 consensus on the forum demonstrating a demand for this pattern I could be
 convinced otherwise but to me this is more of a feature request for a
 niche use case than a bug report.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:13>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019539d636ae-78b9b6c6-8d7d-4905-8e9e-d3e49163fab0-000000%40eu-central-1.amazonses.com.

Reply via email to