def update self instance validated_data instance name validated_data g

1
2
3
4
5
6
7
def update(self, instance, validated_data):
instance.name = validated_data.get('name', instance.name)
instance.save()
return instance
def create(self, validated_data):
return Talk.objects.create(**validated_data)