mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 00:19:53 +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,
|
||||
}
|
||||
for key, label in self.get_valid_fields(queryset, view, context):
|
||||
options.append((key, f'{label} - {_("ascending")}'))
|
||||
options.append(('-' + key, f'{label} - {_("descending")}'))
|
||||
ascending_translation = _("ascending")
|
||||
descending_translation = _("descending")
|
||||
options.append((key, f'{label} - {ascending_translation}'))
|
||||
options.append(('-' + key, f'{label} - {descending_translation}'))
|
||||
context['options'] = options
|
||||
return context
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user