#31657: self referencing foreign key join and order_by issues
-------------------------------+--------------------------------------
     Reporter:  Jack Delany    |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Uncategorized  |                  Version:  3.0
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Simon Charette):

 Something is definitely wrong here.

 - `order_by('record__root_id')` should result in `ORDER BY root_id`
 - `order_by('record__root')` should use the `Meta.ordering` in `ORDER BY
 root_join.id DESC`
 
[https://docs.djangoproject.com/en/3.0/ref/models/querysets/#django.db.models.query.QuerySet.order_by
 as documented]
 - `order_by('record__root__id')` should result in `ORDER BY root_join.id`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31657#comment:2>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.4a104280f03b26ae88a61f3c41e11c47%40djangoproject.com.

Reply via email to