diff --git a/sigi/admin/filterspecs.py b/sigi/admin/filterspecs.py index 5e0ff4f..1d4959b 100644 --- a/sigi/admin/filterspecs.py +++ b/sigi/admin/filterspecs.py @@ -18,9 +18,10 @@ class AlphabeticFilterSpec(ChoicesFilterSpec): model_admin) self.lookup_kwarg = '%s__istartswith' % f.name self.lookup_val = request.GET.get(self.lookup_kwarg, None) - values_list = model.objects.values_list(f.name, flat=True).order_by(f.name) + values_list = model.objects.values_list(f.name, flat=True) # getting the first char of values - self.lookup_choices = set(val[0] for val in values_list) + self.lookup_choices = list(set(val[0] for val in values_list)) + self.lookup_choices.sort() def choices(self, cl): yield {'selected': self.lookup_val is None,