I am getting these urls with django's get_resolver() function for a class:
^api/asset_management/^^get_assets/$
^api/asset_management/^^get_assets\.(?P<format>[a-z0-9]+)/?$
^api/asset_management/^^get_assets/(?P<pk>[^/.]+)/$
^api/asset_management/^^get_assets/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$
I also want the name of the method where each of these url is redirected e.g. Get, Post etc. The class is a simple ModelViewSet and is registered by the DefaultRouter.
viewsets.ModelViewSetwhich is imported from rest_framework. I am only defining theget_querysetmethod while the rest is the default functionality. If this information is not stored anywhere then since similar urls are generated for all the ModelViewSet is it possible to parse the url string to determine the endpoint?