#35356: Issue with OneToOneField and recursive relationships in select_related()
and only().
-------------------------------------+-------------------------------------
Reporter: Joshua van Besouw | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Joshua van Besouw):
Thanks for the quick patch on this!
I can confirm, form my end, that this patch fixes the issue I was
encountering. The `FieldError` was not raised and the following SQL was
used in the resulting query:
{{{
SELECT
"test_project_example"."id",
"test_project_example"."name",
"test_project_example"."source_id",
T2."id",
T2."name",
T3."id",
T3."name"
FROM
"test_project_example"
LEFT OUTER JOIN "test_project_example" T2 ON (
"test_project_example"."source_id" = T2."id"
)
LEFT OUTER JOIN "test_project_example" T3 ON (
"test_project_example"."id" = T3."source_id"
)
ORDER BY
"test_project_example"."id" ASC
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35356#comment:5>
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/0107018ebd6ec457-11c3a3d0-0a88-4757-957d-22147fcffc12-000000%40eu-central-1.amazonses.com.