1

I would like to order a queryset based on a key in a DictionaryField I have using hstore. I currently have the following:

objects = MyModel.objects.filter(**items).filter(
                is_private=False).order_by('dict_field')

the contents of the field are the following:

{'1': '100', '2': '150', ..., 'some_key': 'some_value'}

and I would like to sort solely based off the '1' key. The way I have it right now seems to order the results in an ascending order but with the zero values on top.

Ruben Quinones
  • 2,442
  • 8
  • 26
  • 30

0 Answers0