N
N
Nubbin2018-09-24 13:12:08
Django
Nubbin, 2018-09-24 13:12:08

Django filter Error?

Good afternoon

from django_filters import rest_framework as filters
from rest_framework import viewsets
from rest_framework.filters import SearchFilter, OrderingFilter


class ItemViewSet(viewsets.ModelViewSet):
    __basic_fields = ('name', 'is_text')
    queryset = Items.objects.all()
    serializer_class = ItemsSerializer
    filter_backends = (filters.DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_fields = __basic_fields,
    search_fields = __basic_fields

Guys, what's the problem here, I just can't understand, it gives an error
'tuple' object has no attribute 'split'

I want to filter by multiple items

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
glader, 2018-09-24
@glader

Extra comma after "filter_fields = __basic_fields"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question