Linked Questions

Popular Questions

I'm using SlugRelatedField in my serializer. I want to validate it on a case-insensitive basis, so I add postfix "__iexact" to the "slug_field" attr. And validation works as I need (case-insensitive).

class MySerializer(ModelSerializer):
    customer = serializers.SlugRelatedField(queryset=Customer.objects.all(),

But when I try to get, the following error occurs:
* {AttributeError}'Customer' object has no attribute 'name__iexact'
How can it be solved?

Related Questions