This commit is contained in:
Rex Salisbury 2017-06-05 13:30:59 +00:00 committed by GitHub
commit ab0e23f1bb

View File

@ -107,11 +107,11 @@ class GenericAPIView(views.APIView):
Return the serializer instance that should be used for validating and
deserializing input, and for serializing output.
"""
serializer_class = self.get_serializer_class()
serializer_class = self.get_serializer_class(*args, **kwargs)
kwargs['context'] = self.get_serializer_context()
return serializer_class(*args, **kwargs)
def get_serializer_class(self):
def get_serializer_class(self, *args, **kwargs):
"""
Return the class to use for the serializer.
Defaults to using `self.serializer_class`.