#34615: queryset.order_by().first() is not consistent with other queryset
behaviours
-------------------------------------+-------------------------------------
     Reporter:  Iuri de Silvio       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

 > Thanks! I disagree a bit because if I'm explicitly disabling ordering
 with an empty order_by, it is not the same as not defining ordering.

 I get your original point, but I agree with Mariusz and the original
 authors adding this behaviour.

 To have a first/last you must have deterministic ordering and not whatever
 the database feels like it wants to do otherwise this will start to
 introduce subtle soul-destroying bugs. I've numerous tests fail
 intermittently (with the same db) because we forgot to add explicit
 ordering.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34615#comment:7>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701888077d926-a3683230-a292-469c-9750-b02e51fe0e93-000000%40eu-central-1.amazonses.com.

Reply via email to