carltongibson / django-filter

A generic system for filtering Django QuerySets based on user selections

Home Page:https://django-filter.readthedocs.io/en/main/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wouldn't it be nice to have an "extra_kwargs" fields in Meta of FilterSet like DRF ?

ThalusA opened this issue · comments

I would love to see something consistent with Django Rest Framework with their extra_kwargs approach. Would you mind adding it to django-filters ? https://www.django-rest-framework.org/api-guide/serializers/#additional-keyword-arguments

It would be nice because it wouldn't make us forced to overwrite the default Filter for a specific field.

I don't want to expand the API here. Declare the filters explicitly if needed.

How can I keep the configuration for ModelChoiceFilter for null values and everything else using explicit filters then ? Let's imagine you update your default filters for a specific model, how can I fuse default filters with mine so that my filters won't ever get outdated ? @carltongibson

But filter overrides works per field class, not by field name ? What if I have two foreign key and I want custom overrides different for both of them ?