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

Why is get_queryset_post_processor not applied to querysets in _search? #91

Open
franciscomonsanto opened this issue Sep 22, 2022 · 1 comment

Comments

@franciscomonsanto
Copy link

get_queryset_post_processor is not applied to querysets in _search. Not sure if this is a bug or there is some reason for this, but it seems odd that the queryset_post_processor is applied to the queryset for list requests, but not when a filter is passed.

E.g., I have a queryset_post_processor which returns qs.filter(username__startswith='test'), and my queryset consists of two users, id 1 has username testuser and id 2 has username nottestuser. If I make a GET /Users request, only user 1 is returned. However, if I make a GET /Users/?filter=userName eq "nottestuser", user 2 is returned. I expected the behaviour to be for the 2nd request to not return any result, as filtering the request should return a subset of the results obtained in the request with no filters.

@logston
Copy link
Collaborator

logston commented Oct 8, 2022

Hi @franciscomonsanto, this was an engineering choice. We simply did not need get_queryset_post_processor applied to querysets. If you need such behavior, PRs are welcome but please note that reviews on all PRs are slow to arrive.

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

No branches or pull requests

2 participants