I\'m trying POST a new a Nested Object, the problem is just create the \"top\" object (Playlist), but don\'t create the \"ChannelItem\"...
My Models:
For me, I have a hybrid workaround that I'm OK with. Namely, create a view that has:
_objs
as the suffix and specify it as as read onlyPUT
back to the server reconcile the two aliased fields and store the result in the un-nested serializer fielde.g.
class MSerializer(serializers.HyperlinkedModelSerializer):
foo_objs = TempSensorSerializer(source='foos', many=True, allow_add_remove=True,required=False,read_only=True)
class Meta:
model = M
fields = ('url', 'foos', 'foo_objs')
I don't love this solution, but it beats trying to separately query and collate the nested fields after retrieving the initial container.