#SubQuery Django
2 messages · Page 1 of 1 (latest)
If your outer query targets Thing, then OuterRef("pk") will refer to the parent thing.pk basically. It can be difficult to wrap your head around it.
This page has examples with Post/Comment and Company/Employee that may help to understand: https://docs.djangoproject.com/en/5.0/ref/models/expressions/#subquery-expressions