[Answered ]-How to filter foreign key field by text input in django-filter

1👍

You can filter with:

class PostFilter(django_filters.FilterSet):
    city = django_filters.CharFilter(field_name='city__name')
    class Meta:
        model = Post
        fields = []

You can of course add extra fields on which you wish to filter.

Leave a comment