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
-
I want to use a DRF viewset for all actions on a
ServiceTicket
model exceptlist
(I will use a regular DjangoListView
to display a filterable list page).When I created the following custom
GenericViewSet
, I usedSimpleRouter
and expected to see routes for every function listed EXCEPTlist
. However, a route forlist
IS created. Not until I went back to the explanation ofSimpleRouter
in the docs did I realize that all standard routes are always generated bySimpleRouter
. SinceSimpleRouter
has 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 howSimpleRouter
would work.Beta Was this translation helpful? Give feedback.
All reactions