from the documentation:
read_only Set this to True to ensure that the field is used when serializing a representation, but is not used when updating
I suppose method .get_validation_exclusions() is now removed. I did not found it in ModelSerializer doc and it did not execute after override (djangorestframework==3.8.2). And i am not the only one facing this problem.
My solution is to just add default value for field which i want to be non-required. It supposed to be fine specifically for situations with pre_save:
class FavoriteListSerializer(serializers.ModelSerializer):
owner = serializers.IntegerField(default='')
class Meta:
model = models.FavoriteList
You also have to keep in mind that using drf serializers with pre_save signals may cause implicit behavour (i did not check, but it seems to be logical):
pre_save
is called on pre object save (incredible) which (probably) means after serializer validation.