Last active
January 13, 2016 12:29
-
-
Save eugena/4706681cf0f7dd26a2ad to your computer and use it in GitHub Desktop.
Django REST framework. Update of request.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet): | |
def update(self, request, *args, **kwargs): | |
if request.data: | |
request._full_data = request._full_data.copy() | |
request._full_data['some key'] = 'some new value' | |
return super(SomeViewSet, self).update(request, *args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment