[Django]-Django REST Framework nested serializer won't update

4👍

In order .update() method of WidgetSerializer to be called you need to instantiate serializer differently.

Try using something like this:

widget = Widget.get(pk=something)

serializer = WidgetSerializer(widget, data=data, partial=True) #you need partial if you want to update only some fields
if serializer.is_valid():
    serializer.save()
else:
    print serializer.errors

Leave a comment