[Answered ]-How to validade traverse attributes in DRF Serializer?

1👍

I think you could use the UserSerializer.

class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'

class RegisterStaffSerializerForModerators(serializers.ModelSerializer):
    user = UserSerializer()

    class Meta:
        model = Staff
        ...

Leave a comment