Skip to content

Conversation

@mercelino
Copy link

the function urlencode from urllib handles the case where in the input in query is a list of tuples, but it's not handled in django ninja extra

example:
client_test.get(f'/test', query=[('fields', 'field_name_1'), ('fields', 'field_name_2')]).json()

This will not work in the current version, but it would work if the isinstance(request_params["query"], dict) accepts a list as well

It's useful when passing a list of values for one query parameter.

@eadwinCode
Copy link
Owner

I think this can still work like this

client_test.get(f'/test', query={k:v for k, v in [('fields', 'field_name_1'), ('fields', 'field_name_2')]}).json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants