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)
| 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 | """ |