Re: [Django] #15279: Inheritance of rel fields from a single abstract base class through multiple abstract classes causes errors.

5 views
Skip to first unread message

Django

unread,
Jun 4, 2011, 3:30:14 PM6/4/11
to django-...@googlegroups.com
#15279: Inheritance of rel fields from a single abstract base class through
multiple abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: melinath | Owner: melinath
Type: Bug | Status: new
Milestone: | Component: Database layer
Version: SVN | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords:
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 0
| Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by melinath):

* 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.

Django

unread,
Jun 9, 2011, 10:04:41 PM6/9/11
to django-...@googlegroups.com
#15279: Inheritance of rel fields from a single abstract base class through
multiple abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: melinath | Owner: melinath
Type: Bug | Status: assigned
Milestone: | Component: Database layer
Version: SVN | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords: abstract
Needs documentation: 0 | inheritance
Patch needs improvement: 0 | Has patch: 1
UI/UX: 0 | Needs tests: 0
| Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by melinath):

* keywords: => abstract inheritance
* status: new => assigned
* ui_ux: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:7>

Django

unread,
Dec 13, 2012, 4:31:14 PM12/13/12
to django-...@googlegroups.com
#15279: Inheritance of rel fields from a single abstract base class through
multiple abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: melinath | Owner: melinath
Type: Bug | Status: assigned
Component: Database layer | Version: master

(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: abstract | Needs documentation: 0
inheritance | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

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>

Django

unread,
Dec 13, 2012, 4:31:47 PM12/13/12
to django-...@googlegroups.com
#15279: Inheritance of fields from a single abstract base class through multiple

abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: melinath | Owner: melinath
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: abstract | Needs documentation: 0
inheritance | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:9>

Django

unread,
Jun 13, 2014, 8:20:10 PM6/13/14
to django-...@googlegroups.com
#15279: Inheritance of fields from a single abstract base class through multiple
abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: melinath | Owner: melinath
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: abstract | Needs documentation: 0
inheritance | Patch needs improvement: 1

Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/15279#comment:10>

Django

unread,
Dec 13, 2019, 4:40:50 PM12/13/19
to django-...@googlegroups.com
#15279: Inheritance of fields from a single abstract base class through multiple
abstract classes causes errors.
-------------------------------------+-------------------------------------
Reporter: Stephen Burrows | Owner: Stephen
| Burrows
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: abstract | Triage Stage: Accepted
inheritance |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon):

* 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>

Reply all
Reply to author
Forward
0 new messages