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

Support for []-style array arguments #89

Open
scnerd opened this issue Aug 17, 2019 · 0 comments
Open

Support for []-style array arguments #89

scnerd opened this issue Aug 17, 2019 · 0 comments

Comments

@scnerd
Copy link

scnerd commented Aug 17, 2019

For url parameters passing an array, such as "x__in=[1,2,3]", these are generally encoded as "x__in=1&x__in=2&x__in=3", but can also be passed as "x__in[]=1&x__in[]=2&x__in[]=3" (for example, this is default behavior in the Axios JS library). Django doesn't disambiguate between these, but it'd be nice if django-url-filter searched for parameters that match either naming scheme. E.g.,

value = requests.GET.get(fieldname)
if value is None:
    value = request.GET.getlist(f'{fieldname}[]')
# ...
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