diff options
| author | khamaileon | 2014-05-26 18:43:50 +0200 |
|---|---|---|
| committer | khamaileon | 2014-05-26 18:43:50 +0200 |
| commit | eab5933070d5df9078a6b88e85ee933cbfa28955 (patch) | |
| tree | 350f80a7f2b7f3e4c85a61c91c8fba12bb716630 /rest_framework | |
| parent | 708b6a6c0608dc039e8e9725a8b240c700e0d828 (diff) | |
| download | django-rest-framework-eab5933070d5df9078a6b88e85ee933cbfa28955.tar.bz2 | |
Add the allow_add_remove parameter to the get_serializer method
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/generics.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rest_framework/generics.py b/rest_framework/generics.py index 7bac510f..7fc9db36 100644 --- a/rest_framework/generics.py +++ b/rest_framework/generics.py @@ -90,8 +90,8 @@ class GenericAPIView(views.APIView): 'view': self } - def get_serializer(self, instance=None, data=None, - files=None, many=False, partial=False): + def get_serializer(self, instance=None, data=None, files=None, many=False, + partial=False, allow_add_remove=False): """ Return the serializer instance that should be used for validating and deserializing input, and for serializing output. @@ -99,7 +99,9 @@ class GenericAPIView(views.APIView): serializer_class = self.get_serializer_class() context = self.get_serializer_context() return serializer_class(instance, data=data, files=files, - many=many, partial=partial, context=context) + many=many, partial=partial, + allow_add_remove=allow_add_remove, + context=context) def get_pagination_serializer(self, page): """ |
