Closed andychoi closed 2 years ago
Here is error.
AssertionError: ProjectFilterSet resolved field 'attachment' with 'exact' lookup to an unrecognized field type FileField. Try adding an override to 'Meta.filter_overrides'. See: https://django-filter.readthedocs.io/en/main/ref/filterset.html#customise-filter-generation-with-filter-overrides
My class has FileField, but I didn't include it in filter class as below. I tried to exclude, but still not working
class ProjectFilter(django_filters.FilterSet): class Meta: model = Project exclude = ['attachment'] fields = { 'title' : ['icontains'], 'description' : ['icontains'], }
You can't provide fields and exclude at the same time. The fields setting should be sufficient? 🤔
fields
exclude
Here is error.
My class has FileField, but I didn't include it in filter class as below. I tried to exclude, but still not working