[Answered ]-How to override the create method for a nested serializer for an APIView post request method?

1👍

Adding this to my serializer solved my issue:

class TaggingSerializer(serializers.ModelSerializer):
  tag_id = serializers.PrimaryKeyRelatedField(queryset=Tag.objects.all(),
                                              required=False,
                                              source='tag',
                                              write_only=False)
  resource_id = serializers.PrimaryKeyRelatedField(queryset=Resource.objects.all(),
                                                   required=True,
                                                   source='resource',
                                                   write_only=False)
  gameround_id = serializers.PrimaryKeyRelatedField(queryset=Gameround.objects.all(),
                                                    required=False,
                                                    source='gameround',
                                                    write_only=False)
  user_id = serializers.PrimaryKeyRelatedField(queryset=CustomUser.objects.all(),
                                               required=False,
                                               source='user',
                                               write_only=False)
...

Leave a comment