Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
  • Loading branch information
blaze33 committed Mar 18, 2016
commit 24694ddcb4a17b7ae77d7d4d5f5e48a424e0e04a
2 changes: 1 addition & 1 deletion rest_framework/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def get_valid_fields(self, queryset, view):
]
valid_fields += [
(key, key.title().split('__'))
for key in queryset.query.aggregates.keys()
for key in queryset.query.annotations.keys()
]
else:
valid_fields = [
Expand Down