Intelligent SimpleRouter - only generate urls for standard methods if they are included #8128
              
                Unanswered
              
          
                  
                    
                      DanielSwain
                    
                  
                
                  asked this question in
                Potential Issue
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use a DRF viewset for all actions on a
ServiceTicketmodel exceptlist(I will use a regular DjangoListViewto display a filterable list page).When I created the following custom
GenericViewSet, I usedSimpleRouterand expected to see routes for every function listed EXCEPTlist. However, a route forlistIS created. Not until I went back to the explanation ofSimpleRouterin the docs did I realize that all standard routes are always generated bySimpleRouter. SinceSimpleRouterhas intelligence built into it to create urls for@action-delineated methods, I think it would be better if it would also intelligently determine which of the standard actions are included in the viewset and only generate routes for them. This was my expectation of howSimpleRouterwould work.Beta Was this translation helpful? Give feedback.
All reactions