url('^task/reqs/(?P<pk>\d+)/$', patroltaskviews.PatrolTaskViews.as_view({"get":"getTaskReqs"})),
views视图
class PatrolTaskViews(ModelViewSet):
def getTaskReqs(self,request, *args, **kwargs):
print(kwargs["pk"])
标签:url,ModelViewSet,getTaskReqs,PatrolTaskViews,kwargs,写法 From: https://www.cnblogs.com/kaibindirver/p/17028933.html