mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Update rest_framework/filters.py
Co-authored-by: Tom Christie <tom@tomchristie.com>
This commit is contained in:
parent
3ff562030c
commit
f02d346ec0
|
@ -294,8 +294,10 @@ class OrderingFilter(BaseFilterBackend):
|
||||||
'param': self.ordering_param,
|
'param': self.ordering_param,
|
||||||
}
|
}
|
||||||
for key, label in self.get_valid_fields(queryset, view, context):
|
for key, label in self.get_valid_fields(queryset, view, context):
|
||||||
options.append((key, f'{label} - {_("ascending")}'))
|
ascending_translation = _("ascending")
|
||||||
options.append(('-' + key, f'{label} - {_("descending")}'))
|
descending_translation = _("descending")
|
||||||
|
options.append((key, f'{label} - {ascending_translation}'))
|
||||||
|
options.append(('-' + key, f'{label} - {descending_translation}'))
|
||||||
context['options'] = options
|
context['options'] = options
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user