#21181: collation specific query results ordering
-------------------------------------+-------------------------------------
Reporter: alan.kesselmann@… | Owner: Alan
Type: New feature | Status: assigned
Component: Database layer | Version:
(models, ORM) |
Severity: Normal | Resolution:
Keywords: ORM | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
Now that `order_by` has proper expression support this is pretty
straightforward to implement using an `Expression` of `Func` subclass.
I guess this ticket could be repurposed to allow a `collation` argument to
be passed to `OrderBy` or introduce a backend agnostic `Collate`
expression.
`order_by(F('title').desc(collation='fr_FR'))` or
`order_by(Collate('title', 'fr_FR').desc())`
I think a `Collate` expression would make more sense since it could be
used in lookups as well `filter(title=Collate(Value(title), 'fr_FR'))`.
--
Ticket URL: <https://code.djangoproject.com/ticket/21181#comment:10>
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/083.be84a877a292079aa44f4fe754585840%40djangoproject.com.