drf-writable-nested overriding value on Serializer

63 views
Skip to first unread message

Yago

unread,
Jul 26, 2019, 2:05:53 PM7/26/19
to Django REST framework
Hi.

I'm using drf-writable-nested packet, which provides a CreateMixin and a
UpdateMixin on serializers, avoiding creating code for writble serializers.

Now, I need to get a sum from "price" field children components and
update the parents component field with this value.

I've tried to do that overriding the "create" method, by editing
"validated_data", but even changing that variable, it seems that there's
no effect, once the field still save on database with the original value
which comes from request.

Does anybody has an idea about that behavior?

Reply all
Reply to author
Forward
0 new messages