Commit 24694ddc by Maxime R

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)
parent 36453885
...@@ -245,7 +245,7 @@ class OrderingFilter(BaseFilterBackend): ...@@ -245,7 +245,7 @@ class OrderingFilter(BaseFilterBackend):
] ]
valid_fields += [ valid_fields += [
(key, key.title().split('__')) (key, key.title().split('__'))
for key in queryset.query.aggregates.keys() for key in queryset.query.annotations.keys()
] ]
else: else:
valid_fields = [ valid_fields = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment