{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3280","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3280/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3280/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3280/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3280","id":101366526,"number":3280,"title":"add case insensitive sorting.","user":{"login":"jerzyk","id":199073,"avatar_url":"https://avatars.githubusercontent.com/u/199073?v=3","gravatar_id":"","url":"https://api.github.com/users/jerzyk","html_url":"https://github.com/jerzyk","followers_url":"https://api.github.com/users/jerzyk/followers","following_url":"https://api.github.com/users/jerzyk/following{/other_user}","gists_url":"https://api.github.com/users/jerzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/jerzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerzyk/subscriptions","organizations_url":"https://api.github.com/users/jerzyk/orgs","repos_url":"https://api.github.com/users/jerzyk/repos","events_url":"https://api.github.com/users/jerzyk/events{/privacy}","received_events_url":"https://api.github.com/users/jerzyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-17T08:17:18Z","updated_at":"2015-08-17T08:26:46Z","closed_at":null,"body":"add filter - or option to the existing one - to have possibility to select case insensitive filter, example implementation:\r\n\r\n```\r\nfrom django.db.models.functions import Lower\r\nfrom rest_framework.filters import OrderingFilter\r\n\r\n\r\nclass CaseInsensitiveOrderingFilter(OrderingFilter):\r\n\r\n    def filter_queryset(self, request, queryset, view):\r\n        ordering = self.get_ordering(request, queryset, view)\r\n\r\n        if ordering:\r\n            new_ordering = []\r\n            for field in ordering:\r\n                if field.startswith('-'):\r\n                    new_ordering.append(Lower(field[1:]).desc())\r\n                else:\r\n                    new_ordering.append(Lower(field).asc())\r\n            return queryset.order_by(*new_ordering)\r\n\r\n        return queryset\r\n```"},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/131728842","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3280#issuecomment-131728842","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3280","id":131728842,"user":{"login":"xordoquy","id":2340654,"avatar_url":"https://avatars.githubusercontent.com/u/2340654?v=3","gravatar_id":"","url":"https://api.github.com/users/xordoquy","html_url":"https://github.com/xordoquy","followers_url":"https://api.github.com/users/xordoquy/followers","following_url":"https://api.github.com/users/xordoquy/following{/other_user}","gists_url":"https://api.github.com/users/xordoquy/gists{/gist_id}","starred_url":"https://api.github.com/users/xordoquy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xordoquy/subscriptions","organizations_url":"https://api.github.com/users/xordoquy/orgs","repos_url":"https://api.github.com/users/xordoquy/repos","events_url":"https://api.github.com/users/xordoquy/events{/privacy}","received_events_url":"https://api.github.com/users/xordoquy/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T08:26:46Z","updated_at":"2015-08-17T08:26:46Z","body":"Renaming the title because it's not about filtering."}}