Skip to content

Commit b63d222

Browse files
author
Ryan P Kilby
committed
Allow desc options in OrderingFilter.field_labels
1 parent fb610aa commit b63d222

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_filters/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,8 @@ def build_choices(self, fields, labels):
660660
for field, param in fields.items()
661661
]
662662
descending = [
663-
('-%s' % pair[0], self.descending_fmt % pair[1])
664-
for pair in ascending
663+
('-%s' % param, labels.get('-%s' % param, self.descending_fmt % label))
664+
for param, label in ascending
665665
]
666666

667667
# interleave the ascending and descending choices

0 commit comments

Comments
 (0)