mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Fixed use of deprecated Query.aggregates
In Django 1.8 [`Query.aggregates` is replaced by `annotations`](https://docs.djangoproject.com/es/1.9/releases/1.8/#aggregate-methods-and-modules). Using aggregates currently raises a `RemovedInDjango20Warning`. [Django's source](https://github.com/django/django/blob/1.8/django/db/models/sql/query.py#L192)
This commit is contained in:
parent
3645388547
commit
24694ddcb4
|
@ -245,7 +245,7 @@ class OrderingFilter(BaseFilterBackend):
|
|||
]
|
||||
valid_fields += [
|
||||
(key, key.title().split('__'))
|
||||
for key in queryset.query.aggregates.keys()
|
||||
for key in queryset.query.annotations.keys()
|
||||
]
|
||||
else:
|
||||
valid_fields = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user