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 merge1 commit intoencode:main
base:main
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
@stale
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

CopilotAI 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

@stalestalebot removed the stale labelApr 27, 2025
Copy link
Collaborator

@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.

@stale
Copy link

stalebot commentedJul 19, 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.

@mgaligniana
Copy link
ContributorAuthor

mgaligniana commentedJul 26, 2025
edited
Loading

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.

Yes!

But is because the test is not being run over a PostgreSQL database, right?

I've tried adding this@pytest.mark.skipif(not postgres_fields, reason='PostgreSQL support (postgres_fields) is not available') to see if it is skiped by the CI, but nope! Any suggesiton?

@mgalignianamgaligniana requested a review fromauvipyJuly 26, 2025 14:29
@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch fromdd7d5fc to468d800CompareOctober 16, 2025 17:27
@mgalignianamgalignianaforce-pushed theadd-unaccent-to-search-filter branch from468d800 to227b72fCompareOctober 16, 2025 17:35
@mgaligniana
Copy link
ContributorAuthor

mgaligniana commentedOct 16, 2025
edited
Loading

I've noticed that@ search never had a test with@ filter.

How bad it would be add this without testing? (as it is the same case)

@mgaligniana
Copy link
ContributorAuthor

Hi@browniebroke! Just wondering if my last comment makes sense, or if you have any suggestions. Thank you!

@browniebroke
Copy link
Member

I've noticed that @ search never had a test with@ filter.

Yes precisely. We've got some blind spots in our test coverage and we're trying to cover these kind of missing cases

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

Reviewers

Copilot code reviewCopilotCopilot left review comments

@auvipyauvipyAwaiting requested review from auvipy

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.

4 participants

@mgaligniana@jensjeflensje@browniebroke@auvipy

[8]ページ先頭

©2009-2025 Movatter.jp