#32685: Add feature to preserve order in .filter(field__in=list) query
-------------------------------------+-------------------------------------
     Reporter:  Barney Szabolcs      |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => wontfix
 * component:  Uncategorized => Database layer (models, ORM)
 * type:  Uncategorized => New feature


Comment:

 This behavior depends on a database, it has nothing to do with Django
 itself. If you want to preserve the ordering from the `IN` clause you can
 use `Case` or split your queryset into multiple combined queries. IMO
 neither of these workarounds should be built-in into Django, they are a
 bit hacky and quite niche.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32685#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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.070144bd31d64e4c55b3c5b83f0b198f%40djangoproject.com.

Reply via email to