Skip to content

Added support for annotation return many objects

Compare
Choose a tag to compare
@Friskes Friskes released this 11 Nov 19:56
· 2 commits to main since this release

Example:
`

class StagesSerializer(serializers.Serializer):
    pass

class SomeSerializer(serializers.Serializer):
    stages = serializers.SerializerMethodField()

    def get_stages(self, obj) -> list[StagesSerializer]:
        return StagesSerializer(obj.stages.all(), many=True).data

`