Closed bkfox closed 3 months ago
Yes, that does not work right now -- the SQL would have to contain a JOIN but does not.
There are other projects trying to add CTE support to Django in a more generic way resp. in a way that better leverages the Django ORM's existing features e.g. https://github.com/dimagi/django-cte . Time would probably be better invested there; this library is probably almost too simplistic for this.
This ia a bug; TreeNode
could ship with a system check or something which would detect this situation and emit a django.core.checks.Error
.
Maybe the check could even be implemented on the queryset so that it also works if someone doesn't use the TreeQuerySet
I think this shouldn't be too hard to implement.
Fixed in 7bf2a32a6904a7c385b0f12704492d6642eb8553
When a model subclasses another concrete model, an
Operational Error
is thrown using django's admin website:no such column: T.position
.I've tried with feincms3's, with concrete
Page
subclassingAbstractPage
, andDiffusionPage
subclassingPage
. It seems that is because DiffusionPage holds a fk to Page table and do not contains itself theposition
column.Here is a copy of the generated SQL (sqlite) expression: