#6498: Add case insensitive model ordering
-------------------------------------+-------------------------------------
     Reporter:  Bastian Kleineidam   |                    Owner:  nobody
  <calvin@…>                         |
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Pascal Polleunus):

 It would still be useful to have `__upper` for the `ordering` options in
 models and admin.

 In my `ModelAdmin`…

 I tried `ordering = [Lower("name_lower")]` but it crashes as not handled.

 I tried by overriding `get_queryset()` using
 `qs.order_by(Lower("name_lower"))`.
 My method is executed and returns the correct query (i.e. `ORDER BY
 LOWER("name")`) but it doesn't work in the admin (weird, the list is
 sorted as "-name").
 That query works correctly in PostgreSQL.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/6498#comment:25>
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/096.51f27cdead08b5eec32488340dd7ea17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to