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

Update .get_search_query() to accomodate multiple values of 'q' #266

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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