A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/carltongibson/django-filter/pull/450 below:

Deprecate autogeneration of filters for empty Meta.fields in favor of '__all__' · Issue #450 · carltongibson/django-filter · GitHub

I was somewhat surprised to find that filters are automatically generated for all model fields for the following filterset:

class UserFilter(FilterSet):
    username = filter.CharFilter(lookup_expr='iexact')

    class Meta:
        model = User

>>> UserFilter.base_filters.keys()
['username', 'first_name', 'last_name', 'status', 'is_active', 'favorite_books']

I would have expected just the one username filter. It makes sense to me to deprecate this behavior in favor of using fields = '__all__' - similar to DRF's serializers and Django's ModelForms.

Thoughts?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4