[Django] #33102: Nested natural join query

8 views
Skip to first unread message

Django

unread,
Sep 10, 2021, 3:16:26 PM9/10/21
to django-...@googlegroups.com
#33102: Nested natural join query
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
ManiMozaffar |
Type: New | Status: new
feature |
Component: Database | Version: 3.2
layer (models, ORM) | Keywords: natural join
Severity: Normal | manytomany
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33102>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 11, 2021, 5:40:04 AM9/11/21
to django-...@googlegroups.com
#33102: Nested natural join query
-------------------------------------+-------------------------------------
Reporter: Mani Nikoukalam | Owner: Mani
Mozaffar | Nikoukalam Mozaffar
Type: New feature | Status: assigned
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: natural join | Triage Stage:
manytomany | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mani Nikoukalam Mozaffar):

* owner: nobody => Mani Nikoukalam Mozaffar
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33102#comment:1>

Django

unread,
Sep 11, 2021, 10:08:57 AM9/11/21
to django-...@googlegroups.com
#33102: Nested natural join query
-------------------------------------+-------------------------------------
Reporter: Mani Nikoukalam | Owner: Mani
Mozaffar | Nikoukalam Mozaffar
Type: New feature | Status: closed

Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: wontfix

Keywords: natural join | Triage Stage:
manytomany | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => wontfix


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33102#comment:2>

Reply all
Reply to author
Forward
0 new messages