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

Allows searching with SearchFilter in annotated fields #6240

Merged
merged 1 commit into from Feb 25, 2019

Conversation

Projects
None yet
8 participants
@andrzej3393
Copy link
Contributor

andrzej3393 commented Oct 10, 2018

Description

Fixes bug with searching in annotated fields.
refs #6094

@andrzej3393 andrzej3393 force-pushed the andrzej3393:search-in-annotated-fields branch from 4e2aa13 to 34ee962 Oct 10, 2018

@oliwarner

This comment has been minimized.

Copy link

oliwarner commented Nov 6, 2018

Argl, why won't somebody review and pull this?

@xordoquy

This comment has been minimized.

Copy link
Collaborator

xordoquy commented Nov 7, 2018

@oliwarner because it requires time and energy.
@andrzej3393 thanks for the PR. It looks good though I'd like to avoid creating too many specific models.
Do you think you could reuse the SearchFilterModel at the top of the file for that please ?

@andrzej3393

This comment has been minimized.

Copy link
Contributor Author

andrzej3393 commented Nov 7, 2018

@xordoquy sure, I can reuse it, will push something soon. already done 🙂

@andrzej3393 andrzej3393 force-pushed the andrzej3393:search-in-annotated-fields branch from 34ee962 to eadeed2 Nov 7, 2018

@rpkilby rpkilby self-requested a review Nov 12, 2018

@rpkilby rpkilby added this to the 3.9.1 Release milestone Nov 12, 2018

@rpkilby

This comment has been minimized.

Copy link
Member

rpkilby commented Nov 12, 2018

Thanks for the PR @andrzej3393. Added to the milestone to ensure it's reviewed.

@auvipy

auvipy approved these changes Feb 14, 2019

Show resolved Hide resolved rest_framework/filters.py Outdated
@tuky

This comment has been minimized.

Copy link
Contributor

tuky commented Feb 21, 2019

Wouldn't it be simpler to just try and catch the FieldDoesNotExist exception (and continue in that case)? It should not be must_call_distinct's responsibility to fail on missing fields. The actual query that is made later on will make it fail, anyway. Lets go the EAFP route :-) https://docs.python.org/3/glossary.html#term-eafp

@carltongibson carltongibson force-pushed the andrzej3393:search-in-annotated-fields branch from eadeed2 to 28c7f4d Feb 25, 2019

Incorporated

@carltongibson
Copy link
Collaborator

carltongibson left a comment

OK, I've pulled in @rpkilby's suggested change: the simple use-case looks right; if we need more complex handling of other query expressions then we can look at that with test cases in hand.

Thanks all. @andrzej3393 Welcome aboard! 🎉

@carltongibson carltongibson force-pushed the andrzej3393:search-in-annotated-fields branch from 28c7f4d to 6c197ee Feb 25, 2019

@carltongibson carltongibson merged commit 317174b into encode:master Feb 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.