#34803: Nested OuterRef can raise AttributeError: 'OuterRef' object has no
attribute 'contains_over_clause'
-------------------------------------+-------------------------------------
Reporter: Pierre-Nicolas | Owner: nobody
Rigal |
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) | Resolution:
Severity: Normal | worksforme
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):
* status: new => closed
* resolution: => worksforme
Comment:
Hello pierrenicolasr! As mentioned by David in the previous comment, we
would need a minimal Django project or a test case to reproduce this
issue. I see many tests in the Django test suite that are exercising
nested `OuterRef` calls and they are all passing:
{{{
$ grep -nr "OuterRef(OuterRef" tests/
tests/lookup/tests.py:1303:
Author.objects.filter(alias=OuterRef(OuterRef("name")))
tests/expressions/tests.py:675:
time=OuterRef(OuterRef("time")), pk=OuterRef("start")
tests/expressions/tests.py:688: inner =
SimulationRun.objects.filter(start=OuterRef(OuterRef("pk"))).values(
tests/expressions/tests.py:832:
lastname__startswith=Left(OuterRef(OuterRef("lastname")), 1),
tests/expressions/tests.py:861:
outer_lastname=OuterRef(OuterRef("lastname")),
tests/aggregation/test_filter_argument.py:171:
book_contact_set=OuterRef(OuterRef("pk")),
tests/aggregation/tests.py:1672:
name=OuterRef(OuterRef("publisher__name")),
}}}
So this error seems specific of the complex queries you mention. I'll mark
as `worksforme` for now but happy to reopen if you can provide a
reproducer. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/34803#comment:3>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018a4253c67a-f4740ed7-7d8e-4376-b00d-891c49cf6fde-000000%40eu-central-1.amazonses.com.