Skip to content

Commit

Permalink
Allow desc options in OrderingFilter.field_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan P Kilby committed Nov 4, 2016
1 parent fb610aa commit b63d222
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_filters/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ def build_choices(self, fields, labels):
for field, param in fields.items()
]
descending = [
('-%s' % pair[0], self.descending_fmt % pair[1])
for pair in ascending
('-%s' % param, labels.get('-%s' % param, self.descending_fmt % label))
for param, label in ascending
]

# interleave the ascending and descending choices
Expand Down

0 comments on commit b63d222

Please sign in to comment.