You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
The text was updated successfully, but these errors were encountered:
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 ?
The text was updated successfully, but these errors were encountered: