MCPcopy Index your code
hub / github.com/encode/django-rest-framework / __enter__

Method __enter__

rest_framework/request.py:51–56  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

49 self.action = getattr(view, 'action', None)
50
51 def __enter__(self):
52 self.view.request = clone_request(self.request, self.method)
53 # For viewsets we also set the `.action` attribute.
54 action_map = getattr(self.view, 'action_map', {})
55 self.view.action = action_map.get(self.method.lower())
56 return self.view.request
57
58 def __exit__(self, *args, **kwarg):
59 self.view.request = self.request

Callers

nothing calls this directly

Calls 2

clone_requestFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected