Adjust schema get_filter_fields rules to match framework by carltongibson · Pull Request #5454 · encode/django-rest-framework (original) (raw)

Closes #5237

Generics/ModelViewset performs filtering on: list, retrieve, put, patch and destroy (plus method equivalents).

i.e. on list plus anything that calls get_object.

This PR makes schema generation follow that.

It adds AutoSchema._allows_filters() which can be overridden in subclasses.

I’ve made this initially “private” so we can make quick changes if needs be in a 3.7.1 etc.