#27594: Reverse one to one related object populated from incorrect query columns
-------------------------------------+-------------------------------------
               Reporter:  Daniel     |          Owner:  daniel.hillier@…
  Hillier                            |
                   Type:  Bug        |         Status:  assigned
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  onetoone reverse
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Extracting data for the related object from a queryset with a self
 referential one to one field gets the wrong data (incorrect columns) from
 the query when using a select_related with the reverse field.

 The incorrect columns are introduced by the sqlcompiler mistaking the
 reverse select_related path as a part of a multiple concrete model
 inheritance structure.

 The proposed fix tests for self-referential relationships and avoids the
 multiple concrete model inheritance path in those instances.

 Test added and all other tests are passing.

--
Ticket URL: <https://code.djangoproject.com/ticket/27594>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.3106ddf28a711742e1f393efd38c5c6e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to