Say I have serializers as below.
class AbcSerializer(serializers.ModelSerializer):
class Meta:
model = Abc
fields = ('a',) # there could be other fields too in model.
class XyzSerializer(serializers.ModelSerializer):
a = AbcSerializer(many=True)
class Meta:
Hello,
I've been writing a few NestedSerializers lately, and coming across as
having too much unnecessary boilerplate. I think there's an opportunity to
streamline in a way to serves almost the same use case, but vastly
simplified.
Best demonstrated with an example:
Suppose I have the followin