Feature Request: Nested Natural Join Query

Skip to first unread message

Mani Mozaffar

Sep 10, 2021, 7:47:46 PMSep 10
to Django developers (Contributions to Django itself)


Imagine this case:
Model A
——> Model B(many to many to A)
————-> Model C (many to many to B)
————-——->Model D (many to many to C)

To get a query set of objects D which are connected to an object like A.id=1 , we can do a query like this:
Select * from A natural join B natural join C natural join D

Such a query does not exist as long as I have researched, so I think Django ORM should be modified.

Ken Whitesell

Sep 10, 2021, 8:55:51 PMSep 10
to django-d...@googlegroups.com
Yes, such a query can be written, so no change to the ORM is required for this.

However, this isn't the right mailing list for providing direct assistance.

If you need help constructing such a query, please visit one of the appropriate support venues.
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/cec2baa5-9c36-4151-80d0-eee555f1a977n%40googlegroups.com.

Reply all
Reply to author
0 new messages