def get_rule(self, request, model_cls, method_map):
template = getattr(method_map, request.method)
if not template:
raise exceptions.MethodNotAllowed(request.method)
return template.format(
app_label=model_cls._meta.app_label,
model_name=model_cls._meta.model_name
)
评论列表
文章目录