#26195: order_by pk doesn't work in multi-table inheritance models if parent has
default ordering
-------------------------------------+-------------------------------------
     Reporter:  ris                  |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.9
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  multi table          |             Triage Stage:
  inheritance order_by MTI pk        |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by ris):

 Just adding a note to this: it seems there are actually a good few things
 that will cause an MTI model to throw a hissy fit and silently ignore
 `.order_by()`. I've now found cases where specifying a related model to
 `.order_by()` will cause this behaviour whereas simply adding `__pk` to
 that model lookup will allow it to work fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/26195#comment:4>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.fe098c2fedae9a3b028fa5bcc7ffc6a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to