Opened 3 years ago

Closed 3 years ago

#33102 closed New feature (wontfix)

Nested natural join query

Reported by: Mani Nikoukalam Mozaffar Owned by: Mani Nikoukalam Mozaffar
Component: Database layer (models, ORM) Version: 3.2
Severity: Normal Keywords: natural join manytomany
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,

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 all A, 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.

Change History (2)

comment:1 by Mani Nikoukalam Mozaffar, 3 years ago

Owner: changed from nobody to Mani Nikoukalam Mozaffar
Status: newassigned

comment:2 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: assignedclosed

Django uses internally different JOINs, but you can get the same result. There is no need to modify/add anything to the ORM. If you're having trouble understanding how Django works, see TicketClosingReasons/UseSupportChannels for ways to get help.

Note: See TracTickets for help on using tickets.
Back to Top