#26320: Multi-table inheritance pointer merged with another OneToOneField
-------------------------------------+-------------------------------------
     Reporter:  BertrandBordage      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by charettes):

 We
 
[https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.OneToOneField.parent_link
 explicitly document] that `OneToOneField` will only be used as the link
 back to the parent class iff `parent_link=True`.

 I think the bug lies in `ModelBase.__new__` during `parent_link`
 
[https://github.com/django/django/blob/b886f166b332bda96b178a7327a5118f75d804b6/django/db/models/base.py#L191-L204
 collection]. The `isinstance(field, OneToOneField)` check should also make
 sure that `field.remote_field.parent_link` is truthy.

--
Ticket URL: <https://code.djangoproject.com/ticket/26320#comment:2>
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/073.5a05ee1d9e28ea30878f878aa1972c44%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to