Hello,
N00b here, so apologies if this is a trivial question, but I couldn’t find anything obvious concerning my question in a search.
I have a serializer used as part of an update via a PATCH call.
If a field in the serializer has no value, the associated field in the database is set to NULL when the update is performed. It’s defined like this:
from rest_framework import serializers
class MySerializer(serializers.ModelSerializer):
address_1 = serializers.CharField(required=False, allow_null=True, allow_blank=True)
Is there any way to alter this behaviour in Django? As in: if no value is supplied, then the value in the database is unchanged. Only fields with values are updated.
Thank you in advance for any assistance.