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:
Maxime R 2016-03-18 16:16:13 +01:00
parent 3645388547
commit 24694ddcb4

View File

@ -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 = [