Closed michaelschem closed 2 years ago
I'm trying out the FlexFieldsFilterBackend
. Since I don't want to make it the project default, I've specified it tin the specific viewset that I'm using.
class SkuViewSet(FlexFieldsMixin, viewsets.ReadOnlyModelViewSet):
from rest_flex_fields.filter_backends import FlexFieldsFilterBackend
serializer_class = ExSkuSerializer
queryset = Sku.objects.none()
filter_backends = [FlexFieldsFilterBackend]
My Serializer is defined as follows:
class ExSkuSerializer(FlexFieldsModelSerializer):
class Meta:
model = Sku
fields = ['uid', 'name', 'slug', 'max_qty_per_order']
Unfortunately I get a type error TypeError: _get_expandable_fields() takes 1 positional argument but 2 were given
.
This PR seems to fix that issue by making the method static just like the one above it which I think probably was intended.
thanks!
…but 2 were given