diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 42e77d9108..a4542df108 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -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 = [