[Django] #36183: Model o2o inheritance with abstract models does not "evaluate" a lazy relationship

29 views
Skip to first unread message

Django

unread,
Feb 11, 2025, 4:27:08 AMFeb 11
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Type: Bug
Status: new | Component: Database
| layer (models, ORM)
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
When I define models like this
{{{#!python
class AbstractPage(models.Model):
mtime = models.DateTimeField(
verbose_name="Last modification at",
auto_now=True,
)

class Meta:
abstract = True


class AbstractPageType(models.Model):
page = models.OneToOneField(
"Page",
verbose_name="ID",
primary_key=True,
on_delete=models.CASCADE,
related_name="%(class)s",
parent_link=True,
)
title = models.CharField(
verbose_name="Title",
max_length=255,
null=False,
blank=False,
)

class Meta:
abstract = True


class Page(AbstractPage):
pass


class ArticlePage(AbstractPageType, Page):
pass
}}}
And then I do
{{{#!python
ArticlePage.objects.order_by("-mtime").all()
}}}
I get
{{{
File "django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "django/db/models/query.py", line 1701, in order_by
obj.query.add_ordering(*field_names)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "django/db/models/sql/query.py", line 2249, in add_ordering
self.names_to_path(item.split(LOOKUP_SEP), self.model._meta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "django/db/models/sql/query.py", line 1777, in names_to_path
path_to_parent = opts.get_path_to_parent(model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "django/db/models/options.py", line 755, in get_path_to_parent
targets = (final_field.remote_field.get_related_field(),)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "django/db/models/fields/reverse_related.py", line 311, in
get_related_field
field = self.model._meta.get_field(self.field_name)
^^^^^^^^^^^^^^^^

Exception Type: AttributeError
Exception Value: 'str' object has no attribute '_meta'
}}}

It works when I do
{{{#!python
class ArticlePage(AbstractPageType, Page):
page = models.OneToOneField(
"Page",
verbose_name="ID",
primary_key=True,
on_delete=models.CASCADE,
related_name="%(class)s",
parent_link=True,
)
}}}
but I would prefer not to have to define page field in every PageType.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 12, 2025, 9:52:45 AMFeb 12
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* resolution: => invalid
* status: new => closed

Comment:

Hello BeryCZ, thank you for this report. I've analyzed your models and I
fear that the issue is the complex inheritance that you have proposed.
Specifically, you cannot have a model (`ArticlePage`) that both inherits
from `Page` and has a `OneToOneField` to `Page`. Without understanding
your use case, it feels like a possible solution would be for your "pages"
to have a FK to "page types" (instead of the other way around with the 1-1
field).

Your model definitions create an inheritance conflict:

1. `AbstractPageType` expects a separate `Page` instance (this means every
model that inherits from `AbstractPageType` must have a separate `Page`
instance linked via the `page` field).
2. `ArticlePage` is also inheriting `Page`, which means Django expects
`ArticlePage` itself to be a `Page` instance.

Django sees two competing ways to resolve `ArticlePage`:

* `ArticlePage` is a `Page` (due to model inheritance), or
* `ArticlePage` has a separate `Page` instance (due to the page
`OneToOneField`).

The error is caused because Django tries to retrieve the `mtime` field,
which exists on `Page` (inherited via `AbstractPage`). But because
`ArticlePage` also has a `OneToOneField` called `page`, Django gets
confused about how to resolve `mtime`. Instead of treating `page` as a
relationship to another `Page` instance, Django interprets it as a string.

Solutions are either to remove the direct inheritance to `Page` or remove
the `page` field from `AbstractPageType`.

If you have further questions, there are several user support channels
available. Please refer to TicketClosingReasons/UseSupportChannels for
ways to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:1>

Django

unread,
Feb 12, 2025, 1:11:09 PMFeb 12
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
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 BeryCZ):

Hello Natalia, thanks for your response, but I think you either
misunderstood or I'm missing something that's not clear from your answer.

Based on the docs https://docs.djangoproject.com/en/5.1/topics/db/models
/#multi-table-inheritance I can override the primary key on `ArticlePage`
so instead of `page_ptr` I can have just `page`. So that's what I'm doing,
it works when I put it in `ArticlePage` model, but not when I put it the
`AbstractPageType`.
I've just asked on discord and klove said it should be ok to name the pk
`page`.
So I even tried to remove my custom pk field and checked
`ArticlePage.page` and `article_page_object.page` and both raise
AttributeError, so by default `page` is not there.

My use case is - I want to have the "parent" model `Page` from which I can
MTI "submodels" like Article, Category, Product, Reference, whatever. The
`Page` model will then be used for references in other models (galeries,
urls, tree-maps, ...).

So, am I missing something, or is this a bug? I'm not saying it's an easy-
to-fix bug :) but I honestly think it is a bug.
I'm not even sure where the lazy load of `to` relationship is, or why it
doesn't work in abstract models, otherwise I would try to fix it and PR.

Thank you,
Bery
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:2>

Django

unread,
Feb 12, 2025, 8:49:14 PMFeb 12
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
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 Simon Charette):

Your `AbstractPageType` definition is invalid as it's not allowed to
define a `parent_link` on a model that doesn't directly inherit from the
referenced model even when abstract.

The correct way to do this is to have the abstract model defining the
parent link subclass the concrete model (abstract MTI). This means you
should be able to achieve what you're after by re-organizing your model
definition to make sure `AbstractPageType` does inherit from `Page`

{{{#!python
class AbstractPage(models.Model):
mtime = models.DateTimeField(
verbose_name="Last modification at",
auto_now=True,
)

class Meta:
abstract = True

class Page(AbstractPage):
number = models.IntegerField()

class AbstractPageType(Page):
page = models.OneToOneField(
"Page",
verbose_name="ID",
primary_key=True,
on_delete=models.CASCADE,
related_name="%(class)s",
parent_link=True,
)

class Meta:
abstract = True

class ArticlePage(AbstractPageType):
pass

class OtherPage(AbstractPageType):
pass
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:3>

Django

unread,
Feb 12, 2025, 9:19:39 PMFeb 12
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
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 Simon Charette):

So I tried adapting `BaseModel.__new__` to confirm this was effectively
never supported with

{{{#!diff
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 575365e11c..5a33f78a98 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -243,7 +243,17 @@ def __new__(cls, name, bases, attrs, **kwargs):
for field in base._meta.local_fields:
if isinstance(field, OneToOneField) and
field.remote_field.parent_link:
related = resolve_relation(new_class,
field.remote_field.model)
- parent_links[make_model_tuple(related)] = field
+ related_model_tuple = make_model_tuple(related)
+ if abstract and not any(
+ make_model_tuple(parent) == related_model_tuple
+ for parent in parents
+ if hasattr(parent, "_meta")
+ ):
+ raise TypeError(
+ "Abstract models must directly inherit from
parent "
+ "links they refer to."
+ )
+ parent_links[related_model_tuple] = field

# Track fields inherited from base models.
inherited_attributes = set()
}}}

And the suited failed on
[https://github.com/django/django/blob/47c837a1ff96ef1b10b44477a7a9f72283d12e83/tests/model_inheritance_regress/models.py#L37-L50
these models] which `git-blame` led me to #20883
(163a34ce4bc1086b346a52c7271f48d2c207f710) which makes me believe this
either never fully worked (notice the tests are very minimal) or that the
latest changes to abstract model inheritance field attribution in #24305
(85ef98dc6ec565b1add417bd76808664e7318026).

Given we have models in the suite I think we should at least bisect to
determine if this was ever properly supported but so minimally tested that
#24305 silently broke it. If it never truly worked then I'd suggest we add
this `TypeError` otherwise if it was broken by #24305 we should consider
it like a long standing regression.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:4>

Django

unread,
Feb 13, 2025, 12:54:58 AMFeb 13
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
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 BeryCZ):

Hello Simon, thank you for your response.
The re-organization of the models isnt really a solution, because in my
case the abstracts are in a reusable app and then models are project
specific. I dont like to have concrete models in a reusable app and never
be able to rewrite them, but I should have the `AbstractPageType` in the
reusable app already.

I would really like if it was possible to define the parent_link's field
name in the abstract, so I don't have to define it on all PageType models,
because `page` is much more comfortable to work with than `page_ptr`.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:5>

Django

unread,
Feb 24, 2025, 4:21:22 AMFeb 24
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
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 BeryCZ):

based on the Simon's comment I think this ticket should be Open and
valid...?
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:6>

Django

unread,
Feb 24, 2025, 4:22:00 AMFeb 24
to django-...@googlegroups.com
#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:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by BeryCZ):

* resolution: invalid =>
* status: closed => new

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

Django

unread,
Feb 24, 2025, 9:22:07 AMFeb 24
to django-...@googlegroups.com
#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
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Unreviewed => Accepted

Comment:

I think we can accept a ticket here.

With the following regression test for the git bisect, I bisected the
regression to 513948735b799239f3ef8c89397592445e1a0cd5 (#31426)

{{{#!diff
--- a/tests/model_inheritance_regress/test_regress.py
+++ b/tests/model_inheritance_regress/test_regress.py
@@ -0,0 +1,27 @@
+from django.db import models
+from django.test import TestCase
+
+from .models import Place
+
+
+
+class ParkingLot4(models.Model):
+ # Test parent_link connector can be discovered in abstract classes.
+ parent = models.OneToOneField("Place", models.CASCADE,
parent_link=True)
+
+ class Meta:
+ abstract = True
+
+
+class ParkingLot4C(ParkingLot4, Place):
+ pass
+
+
+class RegressTest(TestCase):
+ def test_use_explicit_o2o_to_parent_from_abstract_model(self):
+ self.assertEqual(ParkingLot4C._meta.pk.name, "parent")
+ ParkingLot4C.objects.create(
+ name="Parking4A",
+ address='21 Jump Street',
+ )
+ ParkingLot4C.objects.order_by("name").all()
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:8>

Django

unread,
Feb 24, 2025, 10:15:58 AMFeb 24
to django-...@googlegroups.com
#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
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* cc: Simon Charette (added)

Comment:

513948735b799239f3ef8c89397592445e1a0cd5 might have altered the way the
problem is surfaced when calling `order_by` but I'd be very surprised if
it was at the origin of the actual regression (if it ever worked).
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:9>

Django

unread,
Feb 24, 2025, 10:43:16 AMFeb 24
to django-...@googlegroups.com
#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 Sarah Boyce):

Updated the test to call values_list:
{{{
self.assertSequenceEqual(
ParkingLot4C.objects.order_by("name").values_list("name",
flat=True),
["Parking4A"]
)
}}}
And tested on 163a34ce4bc1086b346a52c7271f48d2c207f710 the original
commit, this also errors with `AttributeError: 'str' object has no
attribute '_meta'`.
In which case, we have never supported the lazy relationship case (note
that `parent = models.OneToOneField(Place, models.CASCADE,
parent_link=True)` passes).
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:10>

Django

unread,
Feb 24, 2025, 11:12:51 AMFeb 24
to django-...@googlegroups.com
#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):

Thanks Sarah!

In that case it means that #20883 never truly worked but there has been
partial broken support for in `main` for over 13 years (since 1.7).

I guess that leaves us with a few non-mutually exclusive options

1. Add proper support for this pattern
2. Document that he correct way to do this is to have the abstract model
defining the parent link subclass the concrete model and add tests for it
(abstract MTI) (see comment:3)
3. Revert tested support for it since it never really worked and the tests
were very shallow
4. Revert uncovered code once 3. is applied

Given this has been flying under the radar for years and that users in the
wild might have been using 2 (which works just fine) I'd favor all options
but 1.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:11>

Django

unread,
Feb 24, 2025, 2:41:41 PMFeb 24
to django-...@googlegroups.com
#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 BeryCZ):

Honestly I'm in favor of 1.
Not only because it will make my life and the life of my colleagues easier
for (probably) many upcoming years - 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.

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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:12>

Django

unread,
Feb 24, 2025, 4:21:40 PMFeb 24
to django-...@googlegroups.com
#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

unread,
Feb 24, 2025, 11:53:40 PMFeb 24
to django-...@googlegroups.com
#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 BeryCZ):

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.

It's not ideological, it's practical. I'm working on a new cms. We have
built over 300 projects on our old cms in the past ~23years. The old cms
is completely custom, no framework and it's getting kinda "outdated", so
we need a new one. Based on experience I'm expecting few hundereds of
projects each containing ~1-10 page types. And putting the base model into
the reusable app and never be able to add a project-specific field would
be a very bad design.

I suppose it's not an easy-to-fix bug and ofc I understand that you're
busy, but imo it's better to leave this ticket open as "accepted - PR
welcome", even long-term, than hiding it.
I don't need it fixed right away since there is the workaround by defining
parent_link on the concrete submodels. So either I get to it, or you, or
whoever else will need it, or whoever will first have the time :) but it's
better to leave it open for now.

Thanks
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:14>

Django

unread,
Feb 25, 2025, 1:34:27 AMFeb 25
to django-...@googlegroups.com
#36183: Model o2o inheritance with abstract models does not "evaluate" a lazy
relationship
-------------------------------------+-------------------------------------
Reporter: BeryCZ | Owner: (none)
Type: New feature | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* stage: Accepted => Unreviewed
* status: new => closed
* type: Bug => New feature

Comment:

IMO `AbstractPageType` is tightly coupled to `Page` as it overrides the
inheritance behavior of sub-classing `Page`. Having `AbstractPageType` be
defined in the same place as `Page` is reasonable. All models that want to
inherit this, inherit from `Page` anyway, so this doesn't cause things
like circular imports.

-------

I agree that this is a request to support a niche use case that has never
been supported by Django before, hence will categorize this as a new
feature request.

The recommended path forward is to now propose and discuss this with the
community and gain consensus. To do that, please consider starting a new
conversation on the [https://forum.djangoproject.com/c/internals/5 Django
Forum], where you'll reach a broader audience and receive additional
feedback.

Feature requests are closed until there is an agreement to add the
support. Hence, I'll close the ticket for now, but if the community agrees
this should be supported, please return to this ticket and reference the
forum discussion so we can re-open it. For more information, please refer
to [https://docs.djangoproject.com/en/stable/internals/contributing/bugs-
and-features/#requesting-features the documented guidelines for requesting
features].

----
On options 2-4, all are fine to me and I don't think there's a rush. We
could make a decision and create a new ticket for any combination of these
--
Ticket URL: <https://code.djangoproject.com/ticket/36183#comment:15>
Reply all
Reply to author
Forward
0 new messages