Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why mutating request.query_params before calling super.list() doesn't work ? #317

Open
xtrm-co-in opened this issue Dec 19, 2020 · 0 comments

Comments

@xtrm-co-in
Copy link

I want to create an end point where there must be only selected fields be returned as response and I don't want front end to set this query params before placing request, rather I want to programmatically add query parameters. To accomplish this, I am trying to set default fields in include[] query parameter and exclude all others by calling request.query_params.add method before calling list method on Viewset. But this doesn't work, Response object returns all the fields instead.

Why this is not working or is there any better way to do this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant