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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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.
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 theicontains
expression to filter by default, however I did also raise a point about makingname
an exact match and using a field likename__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
andProject.name
, which are bothicontains
expression filters. We might switch back toexact
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:
The text was updated successfully, but these errors were encountered: