Skip to content

API: unify API filter patterns for query fields #9862

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

Open
agjohnson opened this issue Jan 4, 2023 · 1 comment
Open

API: unify API filter patterns for query fields #9862

agjohnson opened this issue Jan 4, 2023 · 1 comment
Labels
Needed: design decision A core team decision is required

Comments

@agjohnson
Copy link
Contributor

This was raised at #9843 (comment)

I found myself wanting a new API filter field on the Project model for the new dashboard work, and reused the current patterns for the new filter fields in #9843. I added a name filter field that used the icontains expression to filter by default, however I did also raise a point about making name an exact match and using a field like name__icontains as the fuzzy search filter.

Perhaps there are better patterns as well, like using django-filters with DRF more?

This could be a good way to improve our API design, and would help include a few missing features that users might want for direct API usage.

We'd first need to decide if it makes sense to alter the existing filter fields like Version.slug and Project.name, which are both icontains expression filters. We might switch back to exact expression filters, though obviously there are backwards incompatibility issues here.

We could also consider exposing exact filters as secondary fields, like Project.name__exact, or perhaps there is something in DRF/django-filters we're not using that could plug in fairly easily too.

Refs:

@agjohnson agjohnson added the Needed: design decision A core team decision is required label Jan 4, 2023
@humitos
Copy link
Member

humitos commented Jul 24, 2023

@agjohnson I want to raise this issue again since we had a similar conversation some week ago. It would be to standardize the pattern now that we are working on this more actively and follow it from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

2 participants