mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Allow to extend serializer context using kwargs of
This commit is contained in:
parent
0dac98d215
commit
6487c9ac98
|
@ -106,7 +106,9 @@ class GenericAPIView(views.APIView):
|
|||
deserializing input, and for serializing output.
|
||||
"""
|
||||
serializer_class = self.get_serializer_class()
|
||||
kwargs['context'] = self.get_serializer_context()
|
||||
serializer_context = self.get_serializer_context()
|
||||
serializer_context.update(kwargs.get("context", {}))
|
||||
kwargs['context'] = serializer_context
|
||||
return serializer_class(*args, **kwargs)
|
||||
|
||||
def get_serializer_class(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user