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

Explicitly query case-insensitively #115

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

chosak
Copy link
Member

@chosak chosak commented Oct 11, 2024

Use of Django filtering with __contains queries case-insensitively on SQLite, but case-sensitively on PostgreSQL. In order to keep case-insensitive search, this commit modifies the logic to use Django __icontains instead [1].

Use of Django filtering with `__contains` queries case-insensitively
on SQLite [0], but case-sensitively on PostgreSQL. In order to keep
case-insensitive search, this commit modifies the logic to use Django
`__icontains` instead [1].

[0] https://docs.djangoproject.com/en/5.1/ref/databases/#substring-matching-and-case-sensitivity
[1] https://docs.djangoproject.com/en/5.1/ref/models/querysets/#icontains
@chosak chosak merged commit 5e86f3b into main Oct 11, 2024
3 checks passed
@chosak chosak deleted the fix/explicit-case-insensitivity branch October 11, 2024 18:46
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