Skip to content

Conversation

typonaut
Copy link

@typonaut typonaut commented Nov 21, 2023

Updated .get_search_query() to deliver a list via .getlist() rather than a string via .get() in order to accomodate multiple values of 'q', for example from forms.MultipleChoiceField() and/or forms.CheckboxSelectMultiple widget.

Updated .get_words() to expect a list rather than a string.

Added .strip_list() to replicate previous behaviour.

Revision to deal with multiple values of 'q', for example where forms.MultipleChoiceField() and/or forms.CheckboxSelectMultiple widget are used (or simply "GET …?q=hello&q=world").

Principally uses .getlist() rather than .get() on the querydict - the querydict.getlist() method is essentially unchanged since Django 1.11, so should not have a backwards compatibility effect.
@typonaut typonaut changed the title Update .get_searh_query() to accomodate multiple values of 'q' Update .get_search_query() to accomodate multiple values of 'q' Nov 21, 2023
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

Successfully merging this pull request may close these issues.

1 participant