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

Method get_method_map

rest_framework/routers.py:226–236  ·  view source on GitHub ↗

Given a viewset, and a mapping of http methods to actions, return a new mapping which only includes any mappings that are actually implemented by the viewset.

(self, viewset, method_map)

Source from the content-addressed store, hash-verified

224 )
225
226 def get_method_map(self, viewset, method_map):
227 """
228 Given a viewset, and a mapping of http methods to actions,
229 return a new mapping which only includes any mappings that
230 are actually implemented by the viewset.
231 """
232 bound_methods = {}
233 for method, action in method_map.items():
234 if hasattr(viewset, action):
235 bound_methods[method] = action
236 return bound_methods
237
238 def get_lookup_regex(self, viewset, lookup_prefix=''):
239 """

Callers 1

get_urlsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected