Skip to content

Instantly share code, notes, and snippets.

@eugena
Last active January 13, 2016 12:29
Show Gist options
  • Save eugena/4706681cf0f7dd26a2ad to your computer and use it in GitHub Desktop.
Save eugena/4706681cf0f7dd26a2ad to your computer and use it in GitHub Desktop.
Django REST framework. Update of request.data
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