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
Source:stackexchange.com