tomchristie/django-rest-framework — pull request #1376 by marccerrato (2014-01-28 10:55:40+00:00)
Title: Get view's serializer from methods if possible when removing invalid ordering fields

When removing invalid fields in OrderingFilter, try to get the serializer from view's `get_serializer` o `get_serializer_class` methods if available. Otherwise, fallback to view's `serializer_class` attribute, passing in a context.

This way, the appropriate serializer will be selected when, for example, different serializers are used depending on the requester user; or when a serializer dinamically generate extra fields depending on the context (requester user, view, ..).