* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* easy: => 0
* needs_docs: 1 => 0
Comment:
This version of the patch works a lot better. The tests actually test
things, and the behavior is more consistent. However, I'm starting to
wonder if this is really the way to go about this. I feel like I'm
constantly struggling against the way that Options keeps track of fields.
For example, I had to add code to the _fill_x_cache methods on Options to
eliminate duplication there, because options.add_field isn't called for
inherited fields. This makes sense, generally, since in the past, fields
have not known what models they were attached to. However, since this
patch introduces field-based tracking of both the model the field was
first declared on and the first concrete model the field was present on,
it would be possible to take that farther. Options could add every field
on the model to a cache, then dish out local fields or inherited fields
based on whether the options' model is the same as the first concrete
model for the field.
However, a change like that would be fairly invasive and far beyond the
scope of this patch, nor am I convinced that it is the best course of
action in terms of efficiency.
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* keywords: => abstract inheritance
* status: new => assigned
* ui_ux: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:7>
Comment (by ptone):
#19465 demonstrates that this issue is in no way specific to related
fields - but fields in general
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:8>
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:9>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
I could reproduce this error on 1.9 but not on 1.10. I bisected the issue
and it looks like it got fixed in
85ef98dc6ec565b1add417bd76808664e7318026.
The fix includes tests that cover
[https://github.com/django/django/blob/85ef98dc6ec565b1add417bd76808664e7318026/tests/model_inheritance/test_abstract_inheritance.py#L252
multiple inheritance from abstract models] so I think this ticket can
simply be marked as fixed.
--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:11>