Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addunaccent toSearchFilter#9385

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mgaligniana wants to merge2 commits intoencode:master
base:master
Choose a base branch
Loading
frommgaligniana:add-unaccent-to-search-filter

Conversation

mgaligniana
Copy link
Contributor

@mgalignianamgaligniana commentedApr 15, 2024
edited
Loading

Description

Based on discussion#7759 I've created this PR to continue the work made in#8775 and#7733

There are no tests with PostgreSQL but I'm creating this to test with the CI

@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch from3a71f9b tof8825baCompareApril 15, 2024 14:10
@mgalignianamgaligniana changed the titleAddunaccent toSearchFilter (based on #7733)Addunaccent toSearchFilterApr 15, 2024
@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch fromf8825ba to2ff3f77CompareApril 15, 2024 14:15
@mgalignianamgaligniana marked this pull request as draftApril 15, 2024 14:20
@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch from2ff3f77 toa2bb1fbCompareApril 15, 2024 18:55
@mgaligniana
Copy link
ContributorAuthor

mgaligniana commentedApr 15, 2024
edited
Loading

Hi@auvipy!

In case I would like to add a postgres db creation step, to be able to add new tests: should I add a step here.github/workflows/main.yml?

@mgaligniana
Copy link
ContributorAuthor

mgaligniana commentedMay 27, 2024
edited
Loading

I move this PR toReady for review as the work is done but I need confirmation on how to add (or if it worth it) a step using PostgreSQL to be able to test it.

Thank you!

@mgalignianamgaligniana marked this pull request as ready for reviewMay 27, 2024 15:49
@jensjeflensje
Copy link

Tried this locally and the unaccent works great. It got me thinking though: anyone usingunaccent is probably not interested in a full match either? The current code limitsicontains from being used too alongside unaccent. I personally set my lookup prefix to"&": "unaccent__icontains" as that better fits my (and probably also other people's) usecases.

@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch froma2bb1fb tof195decCompareAugust 29, 2024 18:16
@staleStale
Copy link

stalebot commentedApr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelApr 26, 2025
@auvipyauvipy requested a review fromCopilotApril 27, 2025 07:56
Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds unaccent support to the SearchFilter, enabling accent‐insensitive searches on PostgreSQL by mapping the "&" prefix to the "unaccent" lookup.

  • Updates the lookup prefixes in the SearchFilter backend
  • Introduces a PostgreSQL‑specific test for unaccent search
  • Updates the API documentation to include the new lookup operator

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
tests/test_filters.pyAdded a new test class that verifies unaccent search functionality
rest_framework/filters.pyUpdated lookup prefixes to include the unaccent operator
docs/api-guide/filtering.mdAdded new documentation row for accent‑insensitive unaccent search lookup

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stalestalebot removed the stale labelApr 27, 2025
Copy link
Member

@auvipyauvipy left a comment
edited
Loading

Choose a reason for hiding this comment

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

test is failing with following error

raise FieldError(
E django.core.exceptions.FieldError: Unsupported lookup 'unaccent' for CharField or join on the field not permitted.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@auvipyauvipyauvipy left review comments

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mgaligniana@jensjeflensje@auvipy

[8]ページ先頭

©2009-2025 Movatter.jp