django-url-filter
django-url-filter copied to clipboard
Support for []-style array arguments
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}[]')
# ...