0

Django already has a way to achieve this for RDBMS:

MyModel.objects.order_by(Lower('myfield'))

I'm using DRF with mongoengine but the above throws error:

TypeError: 'Lower' object is not subscriptable

I'm guessing this is a bug in the way order_by has been implemented in mongoengine.

bagerard
  • 5,681
  • 3
  • 24
  • 48
Jai Sharma
  • 713
  • 1
  • 4
  • 17

1 Answers1

0

I actually think it might be a bug with Django, see: https://code.djangoproject.com/ticket/30557

Don't think that's made it to the 2.2 stable release yet but it's in the Django 3.0 release.

getup8
  • 6,949
  • 1
  • 27
  • 31