#33543: The behaviour of nulls_first and nulls_last is surprising and confusing.
-------------------------------------+-------------------------------------
     Reporter:  Gordon Wrigley       |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     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 Adam Johnson):

 I concur that it is confusing that `nulls_first=False` can still put the
 nulls first, and equally for the `nulls_last=False`.

 I don't think we can change the semantics though as it would be a breaking
 change. The best we can probably do is make passing `False` for either a
 `TypeError`, by swapping their defaults for sentinel values.

 Then, if you need a variable to switch between the behaviours you can use
 a construct like:

 {{{
 F(...).desc(**{("nulls_first" if nulls_first else "nulls_last"): True})
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33543#comment:1>
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/065.5b122ef47ac1db02d87c07c62514b814%40djangoproject.com.

Reply via email to