Is it safe to specify both queryset and get_getqueryset? [VIewSets] #8262
Unanswered
1oglop1
asked this question in
Question & Answer
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.
-
Hi, I have a dilemma about router URLs requiring
basename
argument when the ViewSet does not have a queryset argument.The problem is that
basname
has to be a lowercase string from the Model name unless there is something else.But this requires me to keep track of this in 3 files
models.py
,views.py
andurls.py
where the reference inurls.py
feels very indirect.Is it safe to specify both
queryset
and overrideget_queryset()
onModelViewSet
just for the sake of havingbasename
set automatically by theSimpleRouter
?If not, then what would be good practice here?
Beta Was this translation helpful? Give feedback.
All reactions