So aktualisieren Sie nur einige Felder in der Django Serielizer -Update -Methode

class HeroSerializer(serializers.ModelSerializer):
    class Meta:
        model=Hero
        fields=['id','name','secret_identity']


    def update(self, instance, validated_data):
        instance.secret_identity = validated_data.get('your field name', 'defaultvalue')
        instance.save()
        return instance
Hacker Harsha