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

autocomplete: change genre, office, feast to use icontains search #1156

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

lucasmarchd01
Copy link
Contributor

Fixes #1155

Office and Genre autocomplete widgets are now using icontains search filter on description (name is still istartswith since they are the shorthand letter representation). Feast are now using icontains search filter on name.

@@ -1014,7 +1014,7 @@ def get_queryset(self):
qs = Feast.objects.all().order_by("name")
if self.q:
qs = qs.filter(
Q(name__istartswith=self.q) | Q(feast_code__istartswith=self.q)
Q(name__icontains=self.q) | Q(feast_code__istartswith=self.q)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it occurs to me now - we're not displaying the feast_code anywhere currently (within the autocomplete widget), are we? We should probably not be displaying feast_code matches if the user can't see why it's being matched...

Copy link
Contributor

@jacobdgm jacobdgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for setting this up!

@jacobdgm jacobdgm merged commit f3a7815 into DDMAL:develop 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.

Chant Create/Edit: Feast/Office/Genre autocompletes should do icontains search rather than istartswith
2 participants